Announcement

Collapse
No announcement yet.

PHP_SELF, Headers, Cookies, and more...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP_SELF, Headers, Cookies, and more...

    Ok... I am trying to do a rather interesting hack of vB (as well as the rest of my site) and I have run into trouble... I am hoping you can help.

    I have a sidebar/menu running down the left of my site, and I want to create a Minimize/Maximize button for the sidebar, so that it will disappear and give people with lower resolutions more width to view text in. The method I have taken to do this is as follows:

    A link calls sidebar.php by saying:

    sidebar.php?Mode="Hide"&PreviousLocation=$PHP_SELF

    which toggles a global (to my domain) cookie (in this case to Hide). It then sends the :

    header("Location : $PreviousLocation");

    command back to the browser, so it automatically returns to the page it came from. For pages such as index.php this works perfectly, and I was amazed at how simple it is. However, on pages where things are passed in the url - i.e. showthread.php?threadid=5, the PHP_SELF does not pass a url which includes the variables, so upon returning to the page, it breaks.

    What can I do to pass those values through the sidebar.php file and back to the page that needs them? NOTE: I have tried using cookies, but I dont want to set a cookie for EVERY URL passed value used in EVERY page on my site. I am hoping there will be a better solution. Also, the sidebar.php is generic for the whole site, as is the template which creates the link... so I need generic code to track what values came into the page via the url... as generic as $PHP_SELF.

    Thanks in advance.
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X