parse error, syntax error unexpected t_variable in C\wamp line 51

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Onkemetse
    New Member
    • Dec 2015
    • 1

    parse error, syntax error unexpected t_variable in C\wamp line 51

    this my code
    Code:
    <html> <head> <title>Sign in</title> </head> <body> <h3> Island hospice</h3> <h1>Sign in</h1> <form method="post" action="<?$_SERVER['PHP_SELF'];?>"> <P>Username:</P> <p> <input name="user" type="text" ID="user"/> </p> <p>Password:</p> <p> <input name="pass" type="password" ID="pass"/> </p> <p>Email:</p> <p> <input name="email" type="text" ID="email"/> </p> <input type="submit" value="Create my account" name="submit"  /> <input type="reset" value="Cancel" name="reset" /> <a href="https://bytes.com/login.php" target="_self"> Sign in here </a> <p>*</p> <?=$_SERVER['PHP_SELF'];?> <?PHP
    if (isset($_POST['Submit'])){
    $db=@mysql_connect("localhost","root","");
    mysql_select_db("island",$db);
    if(!$db){
    echo('<p>Application not available. Try again later.</p>');
    exit();
    }
    else{
    echo('<p></p>;
    $user=$_POST["User"];
    $pass=$_POST["Pass"];
    $email=$_POST["Email"];
    
    if ($user ||$pass||$email){
    $query= "INSERT INTO users VALUES('$User','$Pass','$Email')";
    $result=mysql_query($query);
    if($result){
    
    	echo"Thank you $user.You may now";
    	echo('<a href ="https://bytes.com/login.php"target="_self> sign in here</a>');
    	}
    	else{
    	echo('<p>The information you provided is invalid or the username is already taken.Please try agin!</p>');
    	}
    	}
    	else{
    	echo" Enter all the information!";
    	}
    	}
    	}
    	?> </form> </body> </html>
    Last edited by Rabbit; Dec 3 '15, 05:01 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags when posting code or formatted data.

    Your error text says the error is on line 51. The code you posted doesn't have a line 51. Either you didn't paste all your code or you didn't paste the correct code.

    And that's to say nothing of the many of syntactical errors I see just from the code you did paste.

    In addition to that, this is obviously not a SQL Server question. I'm guessing this is PHP? Please let us know what language you're using so we can put this in the correct forum.
    Last edited by Rabbit; Dec 3 '15, 11:29 PM.

    Comment

    Working...