barnes Posted April 26, 2007 Share Posted April 26, 2007 Parse error: parse error in c:\easyphp1-8\www\login.php on line 26 i unable to find this error. login.php <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("user",$con); $username=mysql_real_escape_string($_POST['name']); $pwd=mysql_real_escape_string($_POST['pwd']); if(isset($_POST['name'])) { $q1 = "select username,password from user where username='$username'"; $r1 = mysql_query($q1,$con) or die(mysql_error()); while($res=mysql_fetch_array($r1)) { if($res['password']==$pwd); { echo "your registered sucessfully"; } else { echo "please register"; } } } mysql_close($con) ?> Quote Link to comment Share on other sites More sharing options...
taith Posted April 26, 2007 Share Posted April 26, 2007 missing a ; at the end ;-) <?php $con = mysql_connect("localhost","root",""); if(!$con) die('Could not connect: ' . mysql_error()); mysql_select_db("user",$con); $username=mysql_real_escape_string($_POST['name']); $pwd=mysql_real_escape_string($_POST['pwd']); if(isset($_POST['name'])){ $r1=mysql_query("SELECT username,password FROM `user` WHERE `username`='$username'") or die(mysql_error()); while($res=mysql_fetch_array($r1)){ if($res['password']==$pwd){ echo "your registered sucessfully"; }else{ echo "please register"; } } } mysql_close($con); ?> 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.