NYCPHP Meetup

NYPHP.org

Help! Can't set cookie or redirect!!!

Phil Powell soazine at erols.com
Sat Sep 28 21:03:12 EDT 2002


I am getting the following errors attempting to set a cookie and redirect:

Warning: Cannot add header information - headers already sent by (output started at /users/ppowell/web/my/process.php:5) in /users/ppowell/web/my/process.php on line 76

Warning: Cannot add header information - headers already sent by (output started at /users/ppowell/web/my/process.php:5) in /users/ppowell/web/my/process.php on line 77


Lines:

   setcookie("valLayout", $id, time()+3600*24*30*12*100, $SERVER_NAME); // WILL EXPIRE IN 100 YEARS.. UM YEAH
    header("Location: " . $HTTP_POST_VARS["refURL"]);

The first time I ran this script it set the cookie just fine; subsequent runnings of this script produce this error.  What am I doing wrong, anyone?

Thanx
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20020928/05db02cf/attachment.html>


More information about the talk mailing list