--- In [email protected], "bobsawyerdotcom"
<[EMAIL PROTECTED]> wrote:
> Here's what I WANT to do, but can't seem to achieve:
>
> - if the user comes from one station to the site, the session should
> reflect the station var throughout his visit to the site. Currently,
> it's not holding on to that variable
>
> - if the user comes from one station, leaves, and returns via another
> station, the NEW station var should stick with him throughout his
> visit to the site. Currently, it's not doing that either.
>
> So basically, I want to set a session var (that is gathered through a
> $_GET action) and have it stick. If the $_GET var is different from
> the $_SESSION var (meaning the user revisted from a different
> station), $_SESSION should pick up and retain the new $_GET var.
I *think* that I've gotten this to work like I want it. It seems to
randomly crap out and start displaying the previous station var from
time to time, but at last test appeared to be stable:
session_start();
if ((is_array($_GET)) && isset($_GET['station'])) {
$statvar = $_GET['station'];
if (isset($_SESSION['station'])) {
$_SESSION['station'] == '';
}
$_SESSION['station'] = $statvar;
$station = $_SESSION['station'];
} else {
$station = $_SESSION['station'];
}
-Bob
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/