I've just launched an automotive site that pulls viewers from three
different local radio station sites. The link from the station sites to
the auto site includes a station identifier variable:

http://foo.blah/index.php?station=v103 (or '=dave', or '=waok')

Once on the auto site, I'm setting a $_SESSION variable to keep track
of this identifier so that content, images, banners, etc. are displayed
for the proper station. For instance, station advertisers are different
for each station, so we don't want to show their banners if the station
identifier is not the same as the one for their station. With me?

OK. The problem I'm running into is that if one of our sales reps is
displaying the site for a client, and wants to show them how the site
changes for each station, they have to close the browser to kill the
session, which wastes time and is not particularly elegant.

So - I want to check to see that the station identifier is the same as
the current $_SESSION var, and if not, apply the new station id to the
$_SESSION var.

My code doesn't seem to want to do that:

------------------------------------------

// determine which station we're dealing with
// if not in the $_GET array, try to pull it from $_SESSION
// grab the station ID

if ((is_array($_GET)) && isset($_GET['station'])) {
        $station = $_GET['station'];
        session_start();
        if (!isset($_SESSION['station'])) {
           $_SESSION['station'] = $station;
        }
}

// set a session var so we don't have to keep passing the var
session_start();
if (!isset($_SESSION['station'])) {
        $_SESSION['station'] = $station;
} elseif (isset($_SESSION['station'])) {
        $_SESSION['station'] = $station;
}
$station = $_SESSION['station'];

// continue with code that uses the $station var to 
// set a number of other variables..

----------------------------------------------

After changing station sites and returning to the automotive site, the
first page or two will have the correct station graphics displayed;
after that, it returns to the previous station's graphics. 

This code resides in the header file of each page, btw.

Would someone mind helping me sort this out?

Thanks,
-Bob


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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/
 



Reply via email to