2016-04-10 71 views
0

嘿,伙计们得到一个错误与此代码:与注册PHP错误

<?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"; 
      } 
     } 
    } 
?> 

的错误是

Parse error: syntax error, unexpected 'if' (T_IF) in /home/ubuntu/workspace/registration.php on line 5

所以它在这条线:

if(isset($_REQUEST['submit'])!='') 
+0

呃它确实传递正确。错误所在的行是if(isset($ _ REQUEST ['submit'])!='')并且错误是解析错误:语法错误,意外的'if'(T_IF)在/ home/ubuntu/workspace/registration 。第5行.php –

回答

1

的语法错误缺少分号后include('connect.php')

include('connect.php'); 
//     ^missing