請輸入管理員密碼
\";
echo \"管理員\";??
echo \"
\";
echo \"密碼\";
echo \"
\";
echo \"
\";
echo \"
<\/div>\";???
echo \"<\/form>\";
exit;
}
if($del==1){???????\/\/判斷是否要刪除
mysql_query(\"delete from notebook where time='$time'\",$db); \/\/以留言時間為刪除標志
echo \"刪除成功!\";
}
?>
刪除留言<\/TITLE>
????
???? |
?????? ?????? |
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!";
}
?>
????
????首頁?? ??????> 留言簿?? ??????> 添加留言 |
????查看留言?? ???? |
??
????
???? ?????? ???? |
??
??
delnote.php
include ("config.php");
if ($superadmin){ //如果已經進行管理員登陸,進行密碼驗證
if (!($user==$username)||!($psw==$password)){
echo "密碼錯誤";
exit;
}
}else{ //管理員登陸
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; //帖子總數(shù)
//設每頁顯示10篇,$p總頁數(shù),$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的整倍數(shù),讀取$max除以10的余數(shù),否則取10
if($max==0){$x=0;}//如果沒有帖子,$x取0
$result = mysql_query("select * from notebook ORDER BY time DESC limit $low,$x",$db);
?>
????
???? |
?????? ?????? ???? |
??
????
???? ?????? ?????????? ??????????首頁?? ????????????> 留言簿 | ???????????? ??????????????????????echo "帖子總數(shù): ?",$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????????"留言人:$name | "; echo????????"發(fā)表于:$time | "; echo????????" | "; echo????????" ?$ip  | ?? ";?? echo????????"標題:$title | "; echo????????"留言內容:$nnote | "; } mysql_close($db); ?>????? ???? |
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-...