|
|
|
Terborch
regular
Reg'd: Thu
Posts: 29
|
|
Anyone know anything about php signup & login scripts? I have one and modified it to work on my site. When I tried out the signup part of it, it gave me this message: Quote:
Parse error: syntax error, unexpected T_STRING in signup.php on line 41
Heres the line it's talking about: Quote:
VALUES ('".$_POST['username']."', '".$_POST['pass']."')";
Heres the lines above and below that one to give you a better idea of what its reading: Quote:
// now we insert it into the database $insert = "INSERT INTO users (username, password) VALUES ('".$_POST['username']."', '".$_POST['pass']."')"; $add_member = mysql_query($insert); ?>
What did I miss & how do I fix it?
|
|
ianm
regular
Reg'd: Fri
Posts: 347
Loc: Colchester
|
|
I am no expert but I would look at the quotes in the string thats what the error is pointing clues at, I can see a problem with the concatenation as you dont need the . at the start of $_POST or at the end of you final post array. Try something like this:
VALUES ($_POST['username'].', '.$_POST['pass']);
Also just to see if the variables you are trying to get the values of are holding any data you could try the following to test with:
echo 'username holds ' . $username . '<br />'; echo 'pass holds ' . $pass;
Cheers
|
Zippy_Brown
regular
Reg'd: Fri
Posts: 88
Loc: /dev/null
|
|
Quote:
// now we insert it into the database $insert = "INSERT INTO users (username, password) VALUES ('".$_POST['username']."', '".$_POST['pass']."')"; $add_member = mysql_query($insert); ?>
The // are comment marks, but the comment has part of the next line of code in it. Split the comment and the code apart again by creating a new line after the word database, so it reads:
Quote:
// now we insert it into the database $insert = "INSERT INTO users (username, password) VALUES ('".$_POST['username']."', '".$_POST['pass']."')"; $add_member = mysql_query($insert); ?>
-------------------- Zippy
|
|
|