Forum Moderators: phranque

Message Too Old, No Replies

Can I get a php code to work on a shtml page

Is there a way to use the code to detect a mobil browser

         

bwnbwn

6:57 pm on Nov 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Im trying to add
<?php include('mobile_device_detect.php');
mobile_device_detect(true,true,true,'http://www.example.com/mobile/index.shtml',false); ?>

to the top of my index.shtml page.

Its seems that the code will not work in this format and when i changed the index.shtml to index.php it worked fine. My problem is that the entire website is built in .shtml and it would be alot of work changing them all over to .php to get this line of code to work. Does anyone know how i can get this php to work on shtml pages?

Thanks,

Or is there something in asp that I can use to detect a mobile browser and redirect it to my mobile site.

eelixduppy

7:13 pm on Nov 17, 2008 (gmt 0)



You can parse .shtml files as PHP however it may be more server intensive as all your .shtml file will be parsed as such. However, if you'd like replacing the following in your httpd.conf file should do the trick:

AddType application/x-httpd-php .php .shtml

bwnbwn

10:01 pm on Nov 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks eelixduppy