Advertisement
7_2009-2012 Classes/ Frameworks/ OOP #232995

Mobile/non-mobile site redirect script

This code is for people who have two versions of their site: one for computer browsers, and one for web-enabled phones or PDAs. It automatically detects which is being used to access the site and redirects accordingly. index.php should replace the index page of your site. Rename your current index something else. The local path to that should be the $main variable. When someone accesses index.php from a regular ol' computer, it simply prints out all the information from $main. Really, everything else is explained in the comments. When someone accesses your mobile page via redirection only (NOT manually), at the top it says "click here if you are not on a mobile phone or PDA". When they click that link, it sends you an email with their O/S, browser, and IP address before printing out the contents of the main page. I wanted to do this in a form in index.php, but the T-Mobile Sidekick wasn't passing the variables back. I figured it would be more foolproof just to link. Anyway, if you want to turn off this feature, just comment out the line above "require $mobile" (I didn't write out the line itself because it has html tags). Enjoy! http://www.thanksforthemammaries.net

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Upload
Original Comments (3)
Recovered from Wayback Machine