my problem is after i successfully log in,it is not redirect to page that i supposed to go.
plus, i’m using apache server.
below is the PHP part i think need to be fix.
if($count==1){
// Register $Username, $Password and redirect to file "login_success.php"
session_register("Username");
session_register("Password");
echo "Correct Username & Password";
header("location:$http://localhost/.../contacts.html");
}
else {
echo "Wrong Username or Password";
header("location:../php/error.php");
}
by using
header("location:$http://localhost/.../contacts.html");
i get 403 Forbidden error..
this error were not appear on web page but on firebug.
if i replace with
header( 'Location: http://localhost/.../contacts.html' ) ;
or
header("Location: ./../contacts.html");
or
header('Location: ./../contacts.html');
it gives me no error but its only respond in firebug by showing the html code of the contacts.html and not showing the page itself..
please help me with explanation and how to solve this problem
and sorry for any grammar mistakes and difficulty to understand this 🙂
As said on the documentation, you can’t use
headerif you print some html before.(You can’t even put a blank space before).
Just remove the
echoand it should be fine.