我似乎在这段代码上遇到了困难,我不明白,因为在我的家庭服务器上,它 100% 完美。基本上,这个脚本获取用户 ip 并将其存储到 mysql 表中。每次用户发布时,它都会检查表格以查看 IP 是否已经发布。当我在出现问题的 num_rows 上运行 mysql_error() 时,我得到:
Parse error: syntax error, unexpected T_LOGICAL_OR on line 119
有任何想法吗?
php:
$poster_ip=$_SERVER['REMOTE_ADDR'];//Posters ip
//check for ip double posting
//selecet ip from table
$sql="SELECT * FROM $tbl_name WHERE ip='$poster_ip'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
or die mysql_error();//line 119
//if result matche posterip, table row must be 1
if($count==1){
//ip taken
echo "This IP has already submited a post. You may not submit another.";
exit();
//else script continues
}