您的位置:首页 >> Web开发 >> PHP技术 >> PHP实例 >> 正文
RSS
 

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

http://www.rdxx.com 01年01月12日 00:00 不详 我要投稿

关键词: 留言本
post.php 文件
<?php
     require('config.php');
?>


<?php


$nikename=$arr_request['nikename'];

if (strlen($nikename)==0)
{
   echo "<center>";

   echo "<h2><font color=red>错误信息!</font></h2>";
   echo "对不起,<font color=red>呢称</font>必须填写!!! 请重填!<br>";
   echo "<hr></hr>";
   echo "免费留言本由<a href=http://little.oso.com.cn>小熊</a>提供技术支持";
   echo "</center>";
   exit ;

}

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

  $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 "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">";
        echo "<HTML><HEAD><TITLE>发表文章</TITLE>";
        echo "<META content="text/html; charset=gb2312" http-equiv=Content-Type>";
        echo "<meta HTTP-EQUIV="REFRESH" CONTENT="2;URL=display.php">";
        echo "</head><body topmargin="0"><br>";
        echo "<ul>谢谢你发表留言,将自动显示留言内容";
        echo "&nbsp;<br>";
        echo "<a href=display.php>如果你的浏览器没有自动的返回到留言簿首页,?
                请点这里返回.";
        echo "</a></ul>";


        exit;  

   
  }
?>

index.html 文件

<html>
<center>

<title>谢谢你的留言!</title>
<h1><font color=blue>我的留言本</font></h1>
<font color=navy>首先感谢你的留言,你的每一句话我都会仔细阅读!!!</font>
上一页 下一页

 
 
标签: 留言本 打印本文
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站