I hv make a html file on which I placed 2 fields username and passowrd.I also included a php file named "check.php"
The code in the check.php is as follows:
<body>
<?
$con = mysql_connect("localhost","","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("alauddin", $con);
$name=$_POST['txtusername'];
$password=$_POST['txtpw'];
$result = mysql_query("SELECT username,pw FROM login");
while($row = mysql_fetch_array($result))
{
if($name==$row['username'] && $password==$row['pw']){
$valid_user = 1;
break;
}
else
$valid_user = 0;
}
if($valid_user==1){
header("Location: http://www.google.com");
}
else
header("Location: http://www.yahoo.com");
mysql_close($con);
?>
</body>
Plz Reply soon.