Am making a mafia site and am codin the crew part .. I wont it to move to different pages by the database data. Am connected to the database. <?php if ($fetch->crew=="None") echo header("Location: logged_in.php") else echo " Well come to your crew."; ?> Can any body tell me why this isnt working? Daz.
Don't echo the header("Location: logged_in.php") just header("Location: logged_in.php"); Also, there can be no output to the browser before the header call is made.
And odds are he has HTML code prior to the start of the php code. But you can echo the header so that leaves the variable assignment. Check what its returning then go from there.
You are displaying the header instead of calling the header function. Don't echo it and pass the complete url including http:
Actually, you don't need to pass the complete url. Just remove the echo <?php if ($fetch->crew=="None") header("Location: logged_in.php") else echo " Welcome to your crew."; ?>