Jump to content

Detecting Mobile Browsers


chibineku

Recommended Posts

I have tested my code on my blackberry and most of it looks weird and the javascript doesn't work, even with javascript enabled on the device. I don't expect many people will be trying to place product orders on their phones, but I would like to be able to include them if possible. I would ideally like to use PHP to detect browser, as I already have it working to change content depending on whether the user is on AOL and it'd be an easy addition. Any thoughts? I mean, what's the protocol for browsers choosing the mobile stylesheet and can I piggy back that anyhow? Perhaps embed my PHP in the mobile stylesheet?

Link to comment
Share on other sites

You could put PHP code in a stylesheet, but it's not going to request the stylesheet until after it's requested the page. So you wouldn't know they are a mobile browser until after the page has already loaded. Print out the $_SERVER array and see if you can find anything that indicates it's a mobile device.

Link to comment
Share on other sites

Es muy smarto. Or something. Ta!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...