Home Backend Development PHP Tutorial Guestbook that supports oicq avatar (2)_PHP tutorial

Guestbook that supports oicq avatar (2)_PHP tutorial

Jul 21, 2016 pm 04:03 PM
head html meta oicq two avatar support of

addnote.php



添加留言




    
    
    

医学导航网   
      


include ("config.php"); submit){
$time=date("Y year m month d day H:i:s A");
$ip=$REMOTE_ADDR;//The message ip address
$name=trim( $name);
$email=trim($email);
$title=strip_tags($top);
$nnote=nl2br(strip_tags($content));//Remove the html tag first, Then convert the newline character into
.
If (! $ Name ||! $ Email ||! $ Title ||! $ Nnote) {// Check whether to fill in the complete
Echo "sorry, you must fill in all the content! & Lt; br & gt;". ". "Return";
    exit; }elseif(!ereg('^[-!#$%&'*+./ 0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+ .'.'[-!#$%&'*+./0-9=?A-Z^_`a-z{|}~]+$',$email) //email legality verification
  ){
echo "The email is invalid!
"."Return";
exit;
}
//Write to database
$sql="INSERT INTO notebook (name,email,time,face,ip,title,nnote) VALUES ('$name','$email','$time','$ face','$ip','$title','$nnote')";
$result = mysql_query($sql,$db);
mysql_close($db);
echo "Message success!";
}
?>

    
    
    
  
    
    
  
首页  
      > 留言簿  
      > 添加留言
查看留言  
    

      

        
            
            
            
          
            
            
          
            
            
          
        
  选择一个自己喜欢的头像:

                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
                
              
            
名字 
              
              

              Email  
              
              

              标题  
              
              

              内容

              
            
  
              

                
                
              

            

              

    



  




delnote.php
include ("config.php");
if ($superadmin){ //如果已经进行管理员登陆,进行密码验证
if (!($user==$username)||!($psw==$password)){
echo "密码错误";
exit;
}
}else{ //管理员登陆
echo "
";
echo "
请输入管理员密码
";
echo "管理员";  
echo "
";
echo "密码";
echo "
";
echo "
";
echo "
";   
echo "
";
exit;
}
if($del==1){       //判断是否要删除
mysql_query("delete from notebook where time='$time'",$db); //以留言时间为删除标志
echo "删除成功!";
}
?>



删除留言



$result = mysql_query("SELECT * FROM notebook ",$db);
$row=mysql_num_rows($result);//查看结果有多少行
$max=$row; //帖子总数
//设每页显示10篇,$p总页数,$page第几页,$low 从第几行开始读,$x 读取几行
if (!$page){$page=1;}
$p=ceil($max/10);
$low=10*($page-1);
if($page==$p&&($max%10)<>0){$x=($max%10);} else {$x=10;}//如果是最后一页,且不是10的整倍数,读取$max除以10的余数,否则取10
if($max==0){$x=0;}//如果没有帖子,$x取0
$result = mysql_query("select * from notebook ORDER BY time DESC limit $low,$x",$db);
?>

    
    
    
  
医学导航网   
      

    


    
    


      
          
          
          
          
        
      
首页  
            > 留言簿
  
                      echo "帖子总数:  ",$max,"   第";
          for ($n=1;$n<=$p;$n++){
          echo "$n ";
          }
          echo "页";
          ?>
          
查看留言
  
   for ($i=0;$i<=($x-1);$i++) {
   $email=mysql_result($result,$i,'email');
   $face=mysql_result($result,$i,'face');
   $face='image/face/icon'.$face;
   $name=mysql_result($result,$i,'name');
   $time=mysql_result($result,$i,'time');
   $ip=mysql_result($result,$i,'ip');
   $title=mysql_result($result,$i,'title');
   $nnote=mysql_result($result,$i,'nnote');
echo "";  
echo "";
echo        "";
echo        "";
echo        "";
echo        "  ";  
echo        "";
echo        "
 留言人:$name发表于:$time  $ip
标题:$title
留言内容:$nnote
";
}
mysql_close($db);
?>     
    



www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316278.htmlTechArticleaddnote.php HTML HEAD meta http-equiv=Content-Type content=text/html; charset=gb2312 TITLE添加留言/TITLE style type=text/css !-- .white12 {font-size: 12pt; color: #FFFFFF; text-...
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles