board.php用来存储数据,可以先在里面添加了一条留言纪录。 代码index.php是留言显示和提交页面。 代码",$content);return $content;}if($HTTP_SERVER_VARS['REQUEST_METHOD']=='POST'){$configpath_parts1 = pathinfo($SCRIPT_FILENAME);$time=time();$name=$HTTP_POST_VARS['name'];$url=(preg_match("/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/i",$HTTP_POST_VARS['url']) || $HTTP_POST_VARS['url']=='')?$HTTP_POST_VARS['url']:'http://'.htmlspecialchars(preg_replace("/https?\:\/\//i",'',$HTTP_POST_VARS['url']),ENT_QUOTES);$info=htmlencode($HTTP_POST_VARS['info']);if($name!='' && $info!=''){$Board[]=array($time,$name,$info,$url);}for($i=0;$i";$filename=$configpath_parts1['dirname'].'/'.'board.php';if(is_writable($filename) || !file_exists($filename)){if(!$handle=fopen($filename,'w')){return false;}if(!fwrite($handle,$content)){return false;}fclose($handle);}else{return false;}header('Location:.');}else{?>留言本 '.($bd[3]!=''?'':'').$bd[1].($bd[3]!=''?'':'').': '.$bd[2].'-'.date("G:i, M j, Y",$bd[0]).'';prev($Board);}echo join($s,'');?>