Hi there,

I was hoping someone might help me edit this mobile redirect code so that it includes IPhones with the redirecting process.

Any suggestions?

FYI - Besides this minor exception, it is quite an effective code for redirecting mobile phones. You can try it for yourself, simply enter the following URL into your mobile:
http://www.pcmechanix.ca/

Thanks,

Ash
Webmaster
<URL SNIPPED>

Recommended Answers

All 5 Replies

Create a simple script such as

<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>

And look at the response. Find something uneque to the IPhone E.G. Safari-Mobile etc. and add that to your script

Thanks for the reply! However, I've already found a solution to my current problem off another thread. It turns out that all I have to do adjust the following statement:

if(preg_match("/iphone/i",$_SERVER["HTTP_USER_AGENT"])) return false;

to "return true" instead of "false"

Thanks again,

Glad to see you figured it out

I have published the last version of "Apache Mobile Filter", this open source project has in the first 8 months, more than 1100 downloads from sourceforge and I suppose the same from CPAN.

The Apache Mobile Filter allows you to access WURFL from any programming language, not just Java and php that is traditionally used for dynamic mobile web sites.

The module detects the mobile device and passes the WURFL capabilities on to the other web application as environment variables. It can also be used to resize images on the fly to adapt to the screen size of the mobile device.
Try it and let me know your opinion.

For more info: http://www.idelfuschini.it/it/apache-mobile-filter-v2x.html

I have made two test pages:

PC Test Page: http://apachemobilefilter.nogoogle.it/php_test.php

Mobile Test Page: http://apachemobilefilter.nogoogle.it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.