This question already has an answer here:
- How do I make a redirect in PHP? 31 answers
how can i redirect automatically after log in, instead of click "CLICK HERE"
how can i redirect automatically after log in, instead of click "CLICK HERE"
if (isset($_POST['user']))
{
$user = sanitizeString($_POST['user']);
$pass = sanitizeString($_POST['pass']);
if ($user == "" || $pass == "")
{
$error = "Not all fields were entered <br />";
}
else
{
$query = "SELECT user,pass FROM vbmembers
Where user='$user' AND pass='$pass'";
if (mysql_num_rows(queryMysql($query)) == 0)
{
$error = "Username/Password invalid<br />";
}
else
{
$_SESSION['user'] = $user;
$_SESSION['pass'] = $pass;
die ("You are logged in. Please
<a href='vbmembers.php?view=$user'>Click here</a>.");
}
}
}
}
</div>