Alright, im having problems using headers.
In a login script im using i need to set some cookies.
Although ym problem is that when i put in the redirect coding the cookies are not set!!
what im doing is this
//CONFIGURATION FOR USER PABLO
$whoareyou = 'pablo';
$permission = 'mod';
$permissionbraemar = 'true';
//END CONFIGURATION
setcookie ("WhoAreYou", $whoareyou,time ()+3600); /* expire in 1 hour */
setcookie ("permission", $permission,time ()+3600); /* expire in 1 hour */
setcookie ("permissionsbraemar", $permissionbraemar,time ()+3600); /* expire in 1 hour */
this all works very well. the cookies are set and alls hunky-dory.
BUT when i put this tag in like so
//CONFIGURATION FOR USER PABLO
$whoareyou = 'pablo';
$permission = 'mod';
$permissionbraemar = 'true';
//END CONFIGURATION
setcookie ("WhoAreYou", $whoareyou,time ()+3600); /* expire in 1 hour */
setcookie ("permission", $permission,time ()+3600); /* expire in 1 hour */
setcookie ("permissionsbraemar", $permissionbraemar,time ()+3600); /* expire in 1 hour */
header("location: loggedin.php");
it all screws up. I even tried putting the header locationn bit before setting the cookies as i think i heard somewhere that PHP4 works backwards?😕 That did work either.
When i tried using ob_flsuh(); and ob_end_flush(); and putting the header location after ob_end_flush(); it gave me the error that i cant send output headers.
Im VERY confused as when i dont have the redirect thing it all wors fine, its when they are tpogether!
Im a PHP beginner so ANY help would be appreciated