Jump to content

error rectification


barnes

Recommended Posts

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)

?>

Link to comment
https://forums.phpfreaks.com/topic/48769-error-rectification/
Share on other sites

missing a ; at the end ;-)  :D

<?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);
?>

Link to comment
https://forums.phpfreaks.com/topic/48769-error-rectification/#findComment-239002
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.