In the last two sections, I spoke about guest. php and edit. php. Note the differences between php and html:
Php is usually --> (1) <? Echo ("zihanonline");?>
(2) <? Php
Echo ("zihanonline ");
?>
(3) <script laanguage = "php">
Echo ("zihanonline ");
</Script>
(4) <% echo ("zihanonline"); %>
And so on. Do not confuse.
Next we will study information management: manage. php code.
-----------
// Manage. php
<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: 9 p}
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> incorrect password! The message cannot be deleted! </Font> ";
Echo "<p> the program will return in 3 seconds </p> ";
Echo "<p> <a href = http://zihanonline.longcity.net> sub-han online </a> bamboo 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 '. $ 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> incorrect password! The message cannot be deleted! </Font> ";
Echo "<p> the program will return in 3 seconds </p> ";
Echo "<p> <a href = http://zihanonline.longcity.net> sub-han online </a> bamboo 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> the message has been deleted correctly </font> </p> ";
Echo "<p> the program will return in 3 seconds </p> ";
Echo "<p> <a href = http://zihanonline.longcity.net> sub-han online </a> bamboo 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...