i have a problem with a user validation script i wrote, it validates correclty and everthing but the script itself doesn't refresh the page corectly. the order is the folloing, open the page, login in with the form, which redirects to validate.php who then refreshes to secure.php
the important part of the script goes as following
$query = "SELECT * FROM users1
WHERE user_name='$user_name' AND password='$password'";
//run the query and get the number of affected rows
$result = mysql_query($query, $connection) or die('error making query');
$affected_rows = mysql_num_rows($result);
//if there's exactly one result, the user is validated. Otherwise, he's invalid
if($affected_rows == 1) {
//add the user to our session variables
$_SESSION['username'] = $user_name;
echo " <html>
<head>
<title>Usuario Verificado</title>
<meta http-equiv='refresh' content='1'; url=http://localhost/clphp/secure.php>
</head>
<body>
<div align='left'>Bienvenido $username</div>
</body>
</html>";
}
else {
print 'not valid';
}
the problem with this sript is that it refreshes itself and it doesn't go to secure.php.
i know i could use an include but i want to se if i can do it this way.