首頁 >後端開發 >php教程 >挑战最棒的留言本的源码(二)_PHP

挑战最棒的留言本的源码(二)_PHP

WBOY
WBOY原創
2016-06-01 12:29:09689瀏覽

post.php 文件
require('config.php');
?>




$nikename=$arr_request['nikename'];

if (strlen($nikename)==0)
{
echo "

";

echo "

错误信息!

";
echo "对不起,呢称必须填写!!! 请重填!
";
echo "
";
echo "免费留言本由小熊提供技术支持";
echo "
";
exit ;

}

$date_now=date('Y/m/d H:i:s');
$ip_address=getenv("REMOTE_ADDR");
$messageold=$arr_request['message'];
//$pattern="/n/";
//$replacement="
";

$message=computer_message($messageold,$hang_zifu_number);

$subjectold=$arr_request['subject'];
if (strlen($subjectold)>$hang_zifu_number)

$subject=computer_message($subjectold,$hang_zifu_number);
else
$subject=$subjectold;

$str_sql=" insert into $table_name
(nikename,subject,date_created,ip_address,message,email_address,zhuye_address,oicq)
values
( '$nikename',
'$subject',
'$date_now',
'$ip_address',
'$message',
'".$arr_request['email_address']."',
'".$arr_request['zhuye_address']."',
'".$arr_request['oicq']."'

)";

$result=mysql_db_query($db_name,$str_sql,$id_link);

if (! $result){
affy_error_exit('SQL Insert Execution has failed.');
}

else

{


echo "";
echo "发表文章";
echo "";
echo "";
echo "
";
echo "
    璋㈣阿浣
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn