help with my site register

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
method_man
Forum Contributor
Posts: 257
Joined: Sat Mar 19, 2005 1:38 am

help with my site register

Post 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
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

missing a semi-colon on line 7 you are.

also weird look the quotes on line 6...
method_man
Forum Contributor
Posts: 257
Joined: Sat Mar 19, 2005 1:38 am

thanks

Post by method_man »

thanks dude :D
method_man
Forum Contributor
Posts: 257
Joined: Sat Mar 19, 2005 1:38 am

Post by method_man »

how should i have the quotes on line 6?
method_man
Forum Contributor
Posts: 257
Joined: Sat Mar 19, 2005 1:38 am

Post by method_man »

im getting this error:

Parse error: parse error in /home/www/twarowsk.freeownhost.com/StreetLife/process.php on line 6
method_man
Forum Contributor
Posts: 257
Joined: Sat Mar 19, 2005 1:38 am

Post by method_man »

nevermind, i fixed my problem :D
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

there is the ability to edit your posts you know :lol: . glad you got it sorted out thou
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

also, posting your solution is good for future reference
method_man
Forum Contributor
Posts: 257
Joined: Sat Mar 19, 2005 1:38 am

Post 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");
ody
Forum Contributor
Posts: 147
Joined: Sat Mar 27, 2004 4:42 am
Location: ManchesterUK

Post 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.
Post Reply