I am creating a mobile version of the site. Almost all the major work is done but one confusing thing is becoming a hurdle for me. I have pasted some javascript code on main website to redirect the mobile users to mobile website. Now in the footer of mobile website I also have the link to main website in case if mobile user wish to visit it, he should be able to so easily.
But when he will click on the link redirecting to main website he will be redirected back to the mobile website how should I fix that….
I was thinking about PHP REFERRER
A good tutorial on this can be found here: http://mobile.tutsplus.com/tutorials/mobile-web-apps/mobile-browser-detection/
If you want to keep the user’s choice I’m thinking session or cookie. Either way, check it every time you go through the redirect code and don’t run the code if the user has already expressed his option.