hii
i am trying to write code for Login but its not working.. i have used this code for my another loginpage there its working dont knw y its not on working on my new page.
when ever i click on Login button it goes in else statement that open sorry page.
heres code i am using..
<?php
if(isset($_REQUEST['Login']))
{
$Username=$_REQUEST['username'];
$Password=$_REQUEST['password'];
$query="SELECT * FROM user";
$result=mysql_query($query);
while($nt=mysql_fetch_array($result))
{
if(($nt['name']==$Username)&&($nt['password']==$Password))
{
header("Location:buyticket.php");
break;
}
else
{
header("Location: sorry.php");
break;
}
}
}
i have al the names and variables and matched from my database they are correct.
can anyone tell why it is going in else condition even when i am giving correct username and password