A
Anonymous
Guest
I have just deleted my first, very in detail post about what I thought the problem could've been. But I have narrowed down what I think the problem can be.
I have a function called StorePage which is called from index.php and this function saves the page name to session vars. Then on another page product_display.php which shows the course the user took to get to the page, like so...
Browse > Nokia > Nokia 7260
On the first display of the page, it works perfectly fine. But on a refresh of the page it turns into this
Home > Nokia 7260.
This is what it should like after going from the home page to product_display.php. The funny thing is, is how from index.php the StorePage function stores the same vars which are being displayed. So I played around and changed the values put into the StorePage function on index.php to see if what happens on product_display.php and sure enough whatever shows up after the refresh on product_display.php is what I put in on the values on index.php, regardless of whether or not index.php had been called in this browser session.
The only link between these two pages I can see is in a header("Location: index.php") which happens if the product asked for can not be displayed, but even with this taken out of the product_display script the same problem occurs.
My first solution was to try and put a conditional on index.php as shown below.
But even from product_display.php, this conditional returns true even though if I print out PHP_SELF from product_display.php, on any part of the script it will always print product_display.php
I have a function called StorePage which is called from index.php and this function saves the page name to session vars. Then on another page product_display.php which shows the course the user took to get to the page, like so...
Browse > Nokia > Nokia 7260
On the first display of the page, it works perfectly fine. But on a refresh of the page it turns into this
Home > Nokia 7260.
This is what it should like after going from the home page to product_display.php. The funny thing is, is how from index.php the StorePage function stores the same vars which are being displayed. So I played around and changed the values put into the StorePage function on index.php to see if what happens on product_display.php and sure enough whatever shows up after the refresh on product_display.php is what I put in on the values on index.php, regardless of whether or not index.php had been called in this browser session.
The only link between these two pages I can see is in a header("Location: index.php") which happens if the product asked for can not be displayed, but even with this taken out of the product_display script the same problem occurs.
My first solution was to try and put a conditional on index.php as shown below.
Code:
if ($_SERVER['PHP_SELF'] == 'index.php') {
StorePage("Home", "index.php");
}
But even from product_display.php, this conditional returns true even though if I print out PHP_SELF from product_display.php, on any part of the script it will always print product_display.php