Esato Mobile
General discussions : General : php guru needed - browser detection script
> New Topic
> Reply
< Esato Forum Index > General discussions > General > php guru needed - browser detection script Bookmark topic
Page <  123

wapchimp Posts: > 500

Thanks DSF - I will try it on my .com webhost. Hopefully it will work
--
Posted: 2004-09-21 18:52:52
Edit : Quote

DSF Posts: > 500

no problem

Good luck
--
Posted: 2004-09-22 23:38:04
Edit : Quote

wapchimp Posts: > 500

arrrggghh it still doesn't work. Internet expl & my mobile both get forwarded to /mob directory:

<?
$ok = "http://www.wapchimp.com/mob";
$bad = "http://www.wapchimp.com/web";

$BrowserSplit = explode("/", $HTTP_USER_AGENT);
$Machine = $BrowserSplit[0];

if($Machine == "Opera" || $Machine == "Mozilla") {
header("location: $bad");
}
else {
header("location: $ok");
}
?>
--
Posted: 2004-09-23 02:51:49
Edit : Quote

wapchimp Posts: > 500

wtf is going on?

Do you think it may be the php version on my server?
--
Posted: 2004-09-23 03:00:28
Edit : Quote

DSF Posts: > 500

hmm....
What version of PHP is installed ? (if you don't know make a file with <? phpinfo(); ?>

try:

<?
$ok = "http://www.wapchimp.com/mob";
$bad = "http://www.wapchimp.com/web";

$BrowserSplit = explode("/", $HTTP_SERVER_VARS["HTTP_USER_AGENT"]);
$Machine = $BrowserSplit[0];

if($Machine == "Opera" || $Machine == "Mozilla") {
header("location: $bad");
}
else {
header("location: $ok");
}
?>

http://xpc.go.ro/wap/ WEB
http://xpc.go.ro/wap.wml WML/WAP

[ This Message was edited by: DSF on 2004-09-23 03:12 ]
--
Posted: 2004-09-23 04:11:16
Edit : Quote

wapchimp Posts: > 500

It worked

Thank you
--
Posted: 2004-09-23 12:56:08
Edit : Quote

DSF Posts: > 500

Quote:
On 2004-09-23 12:56:08, wapchimp wrote:
It worked

Thank you


no problem.
which one? the last?
--
Posted: 2004-09-23 13:56:35
Edit : Quote

wapchimp Posts: > 500

Yes the last one

I had 4.2.2 php
_________________
(your resident wap guru)

wapchimp.com

[ This Message was edited by: wapchimp on 2004-09-23 17:13 ]
--
Posted: 2004-09-23 18:13:09
Edit : Quote
Page <  123

New Topic   Reply
Forum Index

Esato home