header() and session issues...

From: Date: Sat, 03 Nov 2001 07:14:18 +0000
Subject: header() and session issues...
Groups: php.general 
Request: Send a blank email to php-general+get-73326@lists.php.net to get a copy of this message
Ola, Can somebody please help me out (I'm losing hair by the hour)? I have two pages, index.php and setstyle.php. If the user clicks the link on index.php it should send them to setstyle.php and automatically back to the index.php with a new session variable set ($style). However, I am using sessions and when the header() function brings the user back to the index.php, it starts a whole new session (WHICH I DON'T WANT). How do I preserve the old session from when index.php was first accessed? Whoever can help me, I appreciate it greatly, and please respond to s@liquidphire.com. (The stupid thing is, I *actually* had this working at one point, then made a change and forgot what exactly I changed and can't restore it, sheesh...) ahmad k. varoqua index.php -------------------------------- <? session_start(); include("includes/globals.inc"); include("includes/functions.inc"); if ($style){ bc_header("search", $style); } else{ bc_header("search", $style2); } print("<a href=./setstyle.php?color=./css/bc_1.css><img src=./images/color1.jpg border=0></a>"); ?> setstyle.php ------------------------------- <? session_start(); session_register('style'); $style=$color; header ("location: $HTTP_REFERER"); //goes back to index.php ?>

« previous php.general (#73326) next »