by atluri.suhas » 27. December 2011 06:07
i have tried both the methods you have mentioned
1). http://localhost/login.html
and
2). http://localhost/dologin.php
The good thing is both are working,but the all the code is written well and free of errors...but the php script is not running..when the http://localhost/dologin.php" is tried it displays all the content written in the " echo " command.,,
this is the content in the error log file
[Tue Dec 27 10:16:35 2011] [notice] Child 2692: Starting thread to listen on port 443.
[Tue Dec 27 10:16:35 2011] [notice] Child 2692: Starting thread to listen on port 80.
[Tue Dec 27 10:17:31 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/dologin, referer: http://localhost/login.html
[Tue Dec 27 10:18:25 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/dologin, referer: http://localhost/login.html
[Tue Dec 27 10:19:31 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/dologin, referer: http://localhost/login.html
i am giving the sample code of the file plz do check them and help me through
login.html
<html>
<head>
<title>login</title>
</head>
<body bgcolor="#66ccff" text="#000000">
<form action="dologin.php" method="get">
<center></br></br>
<h1><font face="lucid handwriting">LOGIN PAGE</font></h1></br></br>
<table cellpaddding=4 cellspacing=2>
<tr>
<td>USER NAME :</td>
<td><input type="text" name="uname"></br></td>
</tr>
<tr>
<td>PASSWORD :</td>
<td><input type="password" name="password"></br></td>
</tr>
<tr>
<td><input type="submit" value="Login" name="login"></td>
</tr>
</table>
</center>
</form>
</body>
</html>
dologin.php
<?php
$num=$_REQUEST['uname'];
$pwd=$_REQUEST['password'];
$conn=mysql_connect("localhost","root","abc123");
$db=mysql_select_db("ex",$conn);
$query="select email_id,password from users";
$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
if($num==$row['email_id']&&$pwd==$row['password'])
{
header("Location: example.html");
}
}
echo "<h1>Invalid username or password</h1>";
?>
example.html
<h1>hai..!!</h1>
plz check them out and let me know..TQ.