Page 1 of 1

help with my site register

Posted: Wed May 25, 2005 9:34 pm
by method_man
whenever i click continue after i enter all of the stuff i need too on my site i get this error:

Parse error: parse error in /home/www/twarowsk.freeownhost.com/StreetLife/process.php on line 8

this is my code

Code: Select all

<?

require('dblink.php');

//mysql query
$query = ' INSERT INTO table_name (username, passw, email) VALUES ("'.$_POST[username].'", "'.$_POST[password].'", "'.$_POST[email].'");
$db_query = mysql_query($query)
$to = $_POST['email'];//the email address the user submitted
$subject = 'You Registered!';
$message = 'You have just registered to play on The Streets. To log in go to the main page and use your username and password to sign in.';//the body of the email you are sending

mail($to, $subject, $message);//mail sent

?>
thanks,

matt

Posted: Wed May 25, 2005 9:43 pm
by Burrito
missing a semi-colon on line 7 you are.

also weird look the quotes on line 6...

thanks

Posted: Wed May 25, 2005 9:46 pm
by method_man
thanks dude :D

Posted: Wed May 25, 2005 9:53 pm
by method_man
how should i have the quotes on line 6?

Posted: Wed May 25, 2005 9:54 pm
by method_man
im getting this error:

Parse error: parse error in /home/www/twarowsk.freeownhost.com/StreetLife/process.php on line 6

Posted: Wed May 25, 2005 10:10 pm
by method_man
nevermind, i fixed my problem :D

Posted: Thu May 26, 2005 9:32 am
by shiznatix
there is the ability to edit your posts you know :lol: . glad you got it sorted out thou

Posted: Thu May 26, 2005 9:55 am
by JayBird
also, posting your solution is good for future reference

Posted: Thu May 26, 2005 4:14 pm
by method_man
well this was my final code

Code: Select all

<?

require('dblink.php');

//mysql query
$query = 'INSERT INTO member (Username, Password, Email) VALUES ("'.$_POST[username].'", "'.$_POST[password].'", "'.$_POST[email].'")';
$db_query = mysql_query($query);
$to = $_POST['email'];//the email address the user submitted
$subject = 'You Registered!';
$message = 'You have just registered to play on The Streets. To log in go to the main page and use your username and password to sign in.';//the body of the email you are sending

mail($to, $subject, $message);//mail sent

?>
and this is dblink.php

Code: Select all

$link = mysql_connect("localhost","mysql","********");

$db_selected = mysql_select_db("mysql");

Posted: Fri May 27, 2005 7:07 am
by ody

Code: Select all

$query = 'INSERT INTO member (Username, Password, Email) VALUES (&quote;'.$_POST&#1111;username].'&quote;, &quote;'.$_POST&#1111;password].'&quote;, &quote;'.$_POST&#1111;email].'&quote;)';
Should really be done like so:

Code: Select all

$query = &quote;INSERT INTO member (Username, Password, Email)
          VALUES ('&quote;.$_POST&#1111;'username'].&quote;', '&quote;.$_POST&#1111;'password'].&quote;', '&quote;.$_POST&#1111;'email'].&quote;')&quote;;
You should also escape the data your feeding in and maybe employ md5 for storing the password.