Forum Moderators: coopster
I have two documents, index.php and main.php.
within index.php, you have to choice out of 3 options (industry_pro, family or student). these options are the vari's carried into main.php (eg main.php?user=student) to set a certain theme and type of site specific to that person.
I wrote a little cookie script that would set a cookie for the vari of the user and then redirect the user once they come back!
in the index.php script, i have done a simple if 'isset' cookie function. here it is:
// find the cookie, if its set, redirect
if (isset($_COOKIE["user"])) {
// redirect
header ('Location: main.php?user=$user');
}
on the main.php pages, i have written a little script, like the one about, to write a cookie if one doesnt exist.
// if cookie isnt there, set it
if (isset($_COOKIE["user"])) { }
else {
// set the cookie
setcookie("user","$user", time() + 604800);
}
however, every time i test the script, i get this error in the main.php file:
Cannot mod header info - headers already sent by (output started at /home/firestar/public_html/roa/main.php:7) in /home/firestar/public_html/roa/main.php on line 13
ob_start();
[us2.php.net...]