Parse error: syntax error, unexpected T_VARIABLE in /home/a4384209/public_html/register.php on line 13

I don't want to sound like an idiot, but I don't know what the T_VARIABLE is...

Someone help please, this is the script.... Also, tell me any other problems you see, I am very, very new to this... 😃

<?php

include ('mysql.php');

if (isset ($POST['submit'])) {
$mysql_user = mysql_escape_string($
POST['username']);
$mysql_password = mysql_escape_string(sha1($_POST['password']));

     if(!empty ($mysql_user) && !empty ($mysql_password))(
            $sql = mysql_query ("INSERT INTO user (
                                 user_id,username,user_password,user_regdate)
                                 VALUES (
                           '0','"$mysql_user."','".$mysql_password."','".time()."')
                           ");

            echo 'Congragulations! You are now registered!';                                    )

     ) else (
             echo 'You must enter a username and password!';
     }

) else (
echo '<form action="register.php" method="post">
Username: <input type="text" name="username" /><br />
Password: <input type="password" name="password" /><br />
<input type="submit" name="submit" value="Register" />
</form>
)

?>

    You left off a dot just before the variable called $mysql_user

    '0','"$mysql_user
    should read:
    '0','".$mysql_user

    Since you broke out of the quotes, the next thing PHP expected was either a dot (to connect more stuff to your string) or a semicolon to end the command. It didn't expect you to say:

    blah blah blah QUOTE variable

    It expected:

    blah blah blah QUOTE dot variable

    Therefore, the variable that you gave it was unexpected so the error message was "unexpected T_VARIABLE". As for why they call it a T_VARIABLE, I don't know.

      Ok, thanks for the help!
      I'll try it out and post anymore problems I have 😃

        Write a Reply...