Results 1 to 2 of 2
Thread: Avoiding PHP redirect loop.
Aug 17, 2006, 11:39 #1
- Join Date
- Oct 2004
- 0 Post(s)
- 0 Thread(s)
Avoiding PHP redirect loop.
I'm currently helping out with CMS'ing a site for a band. As you may have seen, some sites by music groups have a "website cover" behind which the actual site is found. Here's the deal.
The whole site is based on one index.php page with the dynamic part being just the center column, The band wants an option in their configuration interface, where they can switch the "website coverpage" option on and off themselves. It could be something like this: If the "coverpage" option is checked in their webinterface, the value of "1" is set in the parameters table in their DB, and a redirecting header is added to the top of the index.php page with PHP's file manipulation tools, which leads to a script that dynamically generates their fancy coverpage if the DB check returns "1".
But how do i prevent this from looping over and over again when a visitor clicks the "enter site" button? As soon as the visitor lands on the index.php page from the coverpage, the visitor is bound to get redirected once again. What is the best way from a design perspective to prevent this from occurring? Is there a good way to make sure, that the second time that header is encountered by the browser, it's ignored during that visit so the rest of the site can be used without interference from it?
Rock on."There can be only one masterfarter"
Aug 17, 2006, 12:18 #2
- Join Date
- Jul 2005
- West Springfield, Massachusetts
- 198 Post(s)
- 3 Thread(s)
optional "splash" page - one view only
I think the easiest way would be to use a SESSION variable. eg.
$_SESSION['seen'] = "true";Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse