Home > Backend Development > PHP Tutorial > An example of a text guestbook made in PHP (3)_PHP Tutorial

An example of a text guestbook made in PHP (3)_PHP Tutorial

WBOY
Release: 2016-07-21 16:06:19
Original
804 people have browsed it

In the last two sections, I talked about guest.php and edit.php. What needs to be noted is the difference between php and html:
php is usually -->(1)
(2)echo("zihanonline");
">
echo(" zihanonline");
                                                                                                                                                                                                                                                                                             Management: manage.php code.
----------
//manage.php


Leave a message admin






< ;?
include('head.htm');
include("sys.php");
if ($password!=$managepwd and $dispflag)
{


echo "";
echo "

";
echo "Password Error! Unable to delete message!";
echo "

The program will return in 3 seconds

";
echo "

Zihan OnlineBamboo maintenance and management.

";
echo "
";
echo "
";

exit;
}

?> ;


if ($dispflag=="show")
{
$content = file($guestfile);
$count =count($content);
$text="";
for ($h=$count;$h>0;$h--)
{
$text=$text.'nn"; [$h-1];
                                                                                                                                                                                                             ?>>
if ($submit)
{
if ($password!=$managepwd)
{
echo "";
echo "
";
echo "Wrong password! Cannot delete message!" ;
echo "

The program will return in 3 seconds

";
echo "

Zihan Online Bamboo maintenance and management.

";
  echo "
";
  echo "
";

  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 "";
  echo "
";
  echo "

留言已正确删除

";
  echo "

程序将在3秒返回

";
  echo "

子汉在线斑竹维护管理。

";
  echo "
";
  echo "
";
  exit;
  }
  }
  ?>  
      
      
      
  
Delete Message '.$h.":
  
        

  
          
                
          
      





------------
未完待续...

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315484.htmlTechArticle上两节我针对guest.php和edit.php作了讲述.需要注意的是php和html的区别: php通常是--(1)? echo(zihanonline);? (2)? php echo(zihanonline); ? (3)script laanguage=ph...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template