0

Hey guys getting an error with this code :

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

The error is

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

So it's on this line:

if(isset($_REQUEST['submit'])!='')
Izuka
  • 2,572
  • 5
  • 29
  • 34
Daniel Murran
  • 95
  • 2
  • 2
  • 7
  • eh it did pass correct. the line the error is on is if(isset($_REQUEST['submit'])!='') and the error is Parse error: syntax error, unexpected 'if' (T_IF) in /home/ubuntu/workspace/registration.php on line 5 – Daniel Murran Apr 10 '16 at 12:22

1 Answers1

1

The syntax error is a missing semicolon after include('connect.php')

include('connect.php');
//                    ^ missing
MrCode
  • 63,975
  • 10
  • 90
  • 112