By-pass html conditional re-direct?

Status
Not open for further replies.

ButtermilkJack

New Member
I have a small html re-direct set-up on the homepage of one of my sites. The redirect catches IE6 uses and sends them to a page where I tell them how bad IE6 is :D. However, I have a button which lets them go back and browse the site anyway. Needless to say they just end up gping in circles because once they go back to the homepage it sends them back to the IE6 bashing page.

My question is, what's the easiest way to by-pass the IE6 conditional html if they are coming from the IE6 page?
 

Forbairt

Teaching / Designing / Developing
Hmmm what language are you using on the server ? ... have a session and set a flag in it ... if the flag exists don't include the ie redirect ... ? else ...
 

Forbairt

Teaching / Designing / Developing
The basics ...


Each page you have starts a session (first thing you do in your php)... (if you don't ... php forgets about who the user is even if you start it again in a page or two )

First time ... session variable isn't set through the [if ie6 statements you've got set up

Gets redirected to page ... asks do you want to view it anyways ... goes to page and sets session saying yesido=true; add it as a session variable

Back on your main page .... its refreshed and you check .. is this set ... if it is .. don't print the ie6 statement block ... else print it ...

simple enough .. will require a bit of fiddling / testing though :) ...

just remember ... start the session on each page you've got
 

d-tour

New Member
Send them to the redirect page, when they press back have a conditional php statement checking what their referrer page was....

If it was your ie6page let them in.
Sessions are a better choice, but only if they allow them.
Another option is to send use the GET method.
 

Forbairt

Teaching / Designing / Developing
isn't the session automagically appended to the URL (GET) if they don't allow sessions ? :)

Should probably have said ...

Create a cookie with a 1 year time out (again as dtour has pointed out assuming they allow cookies)

This way the next time they hit the site after closing the browser they won't be asked do you want to continue.

BTW excluding IE6 is a bad idea (drawing attention to it) ... given the amount of users that still use it.
 

ButtermilkJack

New Member
Cheer for the help folks. I'm don't want to exclude IE6. I'm actually working on a workaround for the menu it breaks at the moment so the IE6 page is really a temp measure until I get the fix sorted. So, bearing that in mind I'd rather spend my time trying to fix the css for the menu for IE6 than trying to get the IE6 page working.

Anyway, I've just removed the redirect and placed the 'Save the developers' javascript in there for the moment ;). Probably not the best idea as it's a client site and not my own but I'll remove it once I get the fix done.

Thanks again!
 

ButtermilkJack

New Member
It actually turned out to be quite simple enough to fix the css. It was to do with a drop-down menu and IE6 stretching the li elements out to the full width of the div, whereas Gecko browsers treated width: auto as the width of the a tag inside the li.

Schoolboy error :eek:
 
Status
Not open for further replies.
Top