Guestbook that supports oicq avatar (2)_PHP tutorial
WBOYOriginal
2016-07-21 16:03:15870browse
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!"; } ?>
http://www.bkjia.com/PHPjc/316278.htmlwww.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:
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