Page 1 of 1

Login Script...

Posted: Sat Mar 20, 2004 10:34 pm
by Faith
Ok, i'm having trouble with my login script... perhaps someone can help me out. Below is the script I currently have....

Code: Select all

<?php 
$dbh=mysql_connect ("localhost", "equestra_test", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("equestra_members"); 
$username = $HTTP_POST_VARS&#1111;'txtName'];
$password = $HTTP_POST_VARS&#1111;'txtPassword'];
$rs = mysql_query("SELECT * FROM myUsers WHERE Name = '$username' AND Password = '$password' ");//if the user exists if (mysql_num_rows($rs)>0)&#123;  //make a cookie for the user  setcookie("loginname",$username);&#125; ?>
If anyone can help me in any way that'd be very helpful :)

Posted: Sat Mar 20, 2004 10:37 pm
by Illusionist
and waht doesn't work about it??

ummm

Posted: Sat Mar 20, 2004 10:54 pm
by Faith
When you type in the stuff it asks for you get an error message... or a blank screen lol...

Posted: Sat Mar 20, 2004 11:53 pm
by Illusionist
what error message??

this...

Posted: Sun Mar 21, 2004 3:03 pm
by Faith
I'm getting this message:
Parse error: parse error in /home/equestra/public_html/game/phpstuff2/login.php on line 8

Posted: Sun Mar 21, 2004 3:59 pm
by bawla
wuts line 8 of ur script?

hm..

Posted: Sun Mar 21, 2004 5:32 pm
by Faith
Good question...

Posted: Sun Mar 21, 2004 5:43 pm
by bawla
if you open you .php file with notepad and go to edit and "Go To" and u choose your line it will take you to it or with any php editor it has the line numbers on the side

Posted: Sun Mar 21, 2004 7:24 pm
by Illusionist
im guesing this second line is line 8, and it looks pretty shady!!

Code: Select all

$rs = mysql_query("SELECT * FROM myUsers WHERE Name = '$username' AND Password = '$password' ");//if the user exists if (mysql_num_rows($rs)>0){  //make a cookie for the user
you have that whole thing in comment. try this:

Code: Select all

$rs = mysql_query("SELECT * FROM myUsers WHERE Name = '$username' AND Password = '$password' ");//if the user exists
if (mysql_num_rows($rs)>0){  //make a cookie for the user