Guestbook that supports oicq avatar (2)_PHP tutorial
WBOY
Release: 2016-07-21 16:03:15
Original
876 people have browsed it
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!"; } ?>
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