Seem something in my script is causing it to loop infinitely and I am hoping some one can help me figure it out.
Here is the code. It is a simple login script:
<?php
include("config.php");
session_start();
if ($_SESSION['id']!=""){
header("Location: add_category.php");
exit;
}
if (isset($_POST['submit'])){
$name=trim($_POST['name']);
$pass=trim($_POST['password']);
$sql="SELECT id, username, password FROM user_login WHERE username='".$name."' AND password='".$pass."'";
$result=mysql_query($sql);
while($abc=mysql_fetch_array($result)){
if($name==$abc[username] && $pass==$abc[password]){
$userid=$abc['id'];
$_SESSION['id']=$userid;
{
header('Location:add_category.php');
}
}
}
echo "Invalid username/Password<br/><br/>";
}
?>