Example of a text message in PHP (c)

Source: Internet
Author: User
In the last two sections I spoke about guest.php and edit.php. Note the difference between PHP and HTML:


PHP is usually--> (1). Echo ("Zihanonline");? >


(2) PHP


Echo ("Zihanonline");


?>


(3) <script laanguage= "PHP" >


Echo ("Zihanonline");


</script>


(4) <% echo ("Zihanonline");%>


, etc. 4 ways. Don't confuse it.


below we'll look at information management: manage.php code.


-----------


//manage.php<html>





<head>


<title> message Management </title>


<meta http-equiv= "Content-type" content= "text/html"; charset=gb2312 ">


<style>


<!--


a:link {text-decoration:none; color:0000ff}


a:visited {text-decoration:none; color:004080}


a:active {Text-decoration:none}


a:hover {text-decoration:underline; color:ff0000}


body {font-size:9p}


TH {font-size:9pt}


TD {font-size:9pt}


-->


</style>





</head>





<body bgcolor= "#FFFFFF" background= "Back.gif" >


;?


include (' head.htm ');


include ("sys.php");


if ($password!= $managepwd and $dispflag)


  {








echo "<meta http-equiv=refresh content=5;url=guest.php>";


echo "<center>";


echo "<font color=red> password Error! Cannot delete message!</font>";


echo "<p> program will return in 3 seconds </p>";


echo "<p> <a href=http://zihanonline.longcity.net> son Han online </a> owner Maintenance management. </p> ";


echo "<br>";


echo "</center>";





exit;


  }





?>


<table width= "445" border= "0" align= "center" bgcolor= "#CCCCCC" >


<form method= "POST" action= "manage.php" >


;?


if ($dispflag = = "Show")


{


$content = file ($guestfile);


$count =count ($content);


$text = "";


for ($h = $count; $h >0; $h-)


         {


$text = $text. ' <tr><td> delete the '. $h. Message: <input type=checkbox name=check$h value= $h ></td></tr>nn ";


$text = $text. $content [$h-1];


          }


echo "$text";


    }


?>


<input Type=hidden Name=password value=<? echo $password?>>


;?


if ($submit)


  {


if ($password!= $managepwd)


  {


echo "<meta http-equiv=refresh content=5;url=guest.php>";


echo "<center>";


echo "<font color=red> password Error! Cannot delete message!</font>";


echo "<p> program will return in 3 seconds </p>";


echo "<p> <a href=http://zihanonline.longcity.net> son Han online </a> owner Maintenance management. </p> ";


echo "<br>";


echo "</center>";





exit;


  }


   


if ($password = = $managepwd)


  {


$guest _content=file ($guestfile);


$count =count ($guest _content);


for ($j =1; $j <= $count; $j + +)


   {


$del _rec_num= "Check". $j;


$del _num=$ $del _rec_num;


//echo "$del _num: $del _num";


$guest _content[$del _num-1]= "";


   }





$fp =fopen ($guestfile, "w");


for ($i =0 $i <= $count-1; $i + +)


  {


if ($guest _content[$i]!= "")


   {


fputs ($fp, $guest _content[$i],strlen ($guest _content[$i]));


   }


  }


fclose ($FP);


echo "<meta http-equiv=refresh content=5;url=guest.php>";


echo "<center>";


echo "<p><font color=red> message has been correctly deleted </font></p>";


echo "<p> program will return in 3 seconds </p>";


echo "<p> <a href=http://zihanonline.longcity.net> son Han online </a> owner Maintenance management. </p> ";


echo "<br>";


echo "</center>";


exit;


  }


  }


?>


<tr>


<td bgcolor= "#f0f0f0" >


<p align=center>


<input type=submit value= Delete name=submit>





<input type=reset value= rewrite name=reset>


</td>


<tr>


</form>


</table>


<?include (' bottom.htm ');? >


</body>


</html>


------------


to be Continued ...








Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.