Posted by keithwjones - 21 Aug 2011
I have a full website which is in Flash, there is an index.html which calls the Flash. I also have a goMobi site.
I would like to use the PHP detection code as per:
http://www.networksolutions.com/support/assets/gomobi/goMobiTrafficSwitchingGuide.pdf
I have made a copy of the code and called the file mobile.php, I have added the names of the 2 sites to the code. In the index.html file in the first line I have added:
<?php include 'mobile.php'; ?>
This does not appear to work. Please can soemone point me in the right direction to get it working.
Keith




Posted by keithwjones 1 year ago
I have found the same code here:
http://mobiforge.com/developing/page/mobiledesktop-switching-code
But no exact instructions?
Keith
Posted by paddy2k 1 year ago
mobiForge Newbie
Keith,
The switching code in question is written in PHP. You mentioned in your post that you added the include to "index.html", which might cause some issues as most servers required PHP files to have a ".php" extension so they can parse the contents. If your host supports PHP you should be able to rename index.html to index.php and then the switching code should work.
Note, the switching code will only work when visited from a mobile device.
If your host does not support PHP, then you can always use the Javascript redirection detailed in the same switching code document.
For the most up to date switching code see. http://gomobi.info/marketing/switchingcode.html
Yours,
Paddy
Posted by keithwjones 1 year ago
Paddy
Thanks for reply at present I am using the Javascript which appears to work well.
I found the PHP code of Andy Moore, for which there is a charge, but that worked. I did add an .htaccess file;
Changing to index.php the site works but when you add device dection code it just shows a blank page, the same as index.html.
I also managed to get it into an infinite redirection loop - which should be solved by adding rewrite to .htaccess but no luck so far.
The latest goMobi code, which is different to what I have been trying, so I will have a go with that next.
But it is not clear to me what I should add to index.php/html to get it to work. Please can anyone tell me?
Keith
Posted by fugangs 1 year ago
Thank you for this very helpful post keith.
winalite review