Jay2391 Posted September 20, 2006 Share Posted September 20, 2006 I hace a DB with a tabletable fields are userIDuserpassemail I am getting this error???Parse error: syntax error, unexpected $end in /home/jreina88/public_html/natgal/login.php on line 59that is the last line ...can some one help this is the codethis is the code!!!!<? session_start() ?><HTML><HEAD><TITLE>Login</TITLE></HEAD><BODY><H2>Login</H2><?php $links = "<A HREF='main.php'>Click here to proceed to the main page</A><BR><BR><A HREF='logout.php'>Click here to log out.</A>"; if($user && $pass){ if ($logged_in_user == $user) { echo $user.", you are already logged in.<BR><BR>"; echo $links; exit; } $db=mysql_connect ("localhost", "ID", "pass") or die ('I cannot connect to the database because: ' . mysql_error());mysql_select_db("database name");$result = mysql_query("SELECT * FROM tablename WHERE user = '".$user."' AND password = PASSWORD('".$pass."')"); if (!$result) { echo "Sorry, there has been a technical hitch. We cannot enter your details."; exit; } if(mysql_num_rows($result) > 0 ){ $logged_in_user = $user; session_register("logged_in_user"); echo "Welcome, ".$logged_in_user.". <br><br>"; echo $links; exit; } else { echo "Invalid login. Please try again.<br><br>"; } // else if ($user || $pass) { // echo "Please fill in both fields.<BR><BR>"; // }?><FORM METHOD=POST ACTION="login.php"> Your username: <INPUT NAME="user" TYPE=TEXT MAXLENGTH=20 SIZE=20> <BR> Your password: <INPUT NAME="pass" TYPE=PASSWORD MAXLENGTH=10 SIZE=10> <BR> <INPUT TYPE=SUBMIT VALUE="Login"> </FORM></BODY></HTML> Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted September 20, 2006 Share Posted September 20, 2006 r u giving all source the error says its on 59 and theres only 49 there if i am correct Quote Link to comment Share on other sites More sharing options...
Jay2391 Posted September 20, 2006 Author Share Posted September 20, 2006 I am giving you what i have .... I just do not see it...frustrating Quote Link to comment Share on other sites More sharing options...
btherl Posted September 20, 2006 Share Posted September 20, 2006 Here, you open two { but only close with one } .. this could be the problem:[code] if($user && $pass){ if ($logged_in_user == $user) { echo $user.", you are already logged in.<BR><BR>"; echo $links; exit; }[/code] Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted September 20, 2006 Share Posted September 20, 2006 <FORM METHOD=POST ACTION="login.php"> Your username: <INPUT NAME="user" TYPE=TEXT MAXLENGTH=20 SIZE=20> <BR> Your password: <INPUT NAME="pass" TYPE=PASSWORD MAXLENGTH=10 SIZE=10> <BR> <INPUT TYPE=SUBMIT VALUE="Login"> </FORM>should be [code]<FORM METHOD="POST" ACTION="login.php"> Your username: <INPUT NAME="user" TYPE="TEXT" MAXLENGTH="20" SIZE="20"> <BR> Your password: <INPUT NAME="pass" TYPE="PASSWORD" MAXLENGTH="10" SIZE="10"> <BR> <INPUT TYPE="SUBMIT" VALUE="Login"> </FORM>[/code]just try thissorry for telling u it was only 49 i was counting them up cuz my explorer was messing up i hate it like XP well really its my comp Quote Link to comment Share on other sites More sharing options...
Jay2391 Posted September 20, 2006 Author Share Posted September 20, 2006 I apreciate that i will try that tonite at home ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.