April 27, 2012

Parse error: syntax error, unexpected T_VARIABLE in /home/rixo/public_html/login/process.php on line 41

Question by Jack-T

I am new to php. I keep having this error – Parse error: syntax error, unexpected T_VARIABLE in /home/rixo/public_html/login/process.php on line 41

Here is the full code – http://pastebin.com/8Yqmk0MX

If you could look through it for me and see what is the problem it would be a great help.

-Thank you in advance

Answer by Starx

Its due to unclosed quote on this line

$checkuser = mysql_query('SELECT username FROM user WHERE username='$user');

Fix it

$checkuser = mysql_query("SELECT username FROM user WHERE username='$user'");

Update:

Found another query error on line 61 of the paste. There is mismatching quotes

$write = “INSERT INTO user (username, password, email) VALUES ('$user', '$pwd', '$mail’)';

Fix them

$write = "INSERT INTO user (username, password, email) VALUES ('$user', '$pwd', '$mail')";

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!