467,910 Members | 1,564 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

Parse error: parse error, unexpected $ in...

I am writing a very simple login script for a website that I am also writing, but when I try to run it, the only error I get is:
Parse error: parse error, unexpected $ in /home/www/zammarket.freehostia.com/signup.php on line 22
Line 22 is the last line in the file.
My code is here:
[PHP]
<?php
echo "Starting...";
@mysql_connect(My_Sql_Server, My_DB, My_Password) or die("Cannot Connect To DB!");
@mysql_select_db(My_DB) or die("Cannot Select DB!");
echo "Connected!";
$sql = "INSERT INTO users (username, password, rsusername) VALUES('" .
$_POST['Username'] .
"','" .
$_POST['Password'] .
"','" .
$_POST['RSUsername'] .
');";
echo "SQL Statement Written";
$r = mysql_query($sql);
echo "Query Performed";
if(!$r) {
echo "Error!"
$err=mysql_error();
print $err;
exit();
}
?>
[/PHP]
the My_SQL_Server, My_DB, and My_Password are all replaced with the proper values.
Jul 16 '07 #1
  • viewed: 1041
Share:
3 Replies
Never Mind, I fixed it by changing line 12:
');";
to:
"');";
and line 17:
echo "Error!"
to:
echo "Error!";
Jul 16 '07 #2
ak1dnar
Expert 1GB
Thanks for sharing the solution with the others.
best of luck!
-Ajaxrand
Jul 16 '07 #3
pbmods
Expert 4TB
Heya nazgul.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)

Thanks for posting the solution, too.
Jul 16 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Marten van Urk | last post: by
6 posts views Thread by Ehartwig | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.