嘿,伙计们用这个代码得到了一个错误:
<?php //start php tag
//include connect.php page for database connection
include('connect.php')
//if submit is not blanked i.e. it is clicked.
if(isset($_REQUEST['submit'])!='')
{
if($_REQUEST['name']==''||$_REQUEST['email']==''||$_REQUEST['password']=='')
{
echo "please fill the empty field.";
}
else
{
$sql="insert into FunReads(user_name,user_email,user_password) values('".$_REQUEST['name']."', '".$_REQUEST['email']."', '".$_REQUEST['password']."')";
$res=mysql_query($sql);
if($res)
{
echo "Record successfully inserted";
}
else
{
echo "There is some problem in inserting record";
}
}
}
?>
错误为
分析错误:语法错误,第5行上/home/ubuntu/workspace/registration.php中出现意外的"if"(T_if)
所以它在这条线上:
if(isset($_REQUEST['submit'])!='')
语法错误是include('connect.php')
后缺少分号
include('connect.php');
// ^ missing