>
New Topic
>
Reply<
Esato Forum Index
>
General discussions >
General
> php guru needed - browser detection script
Bookmark topic
Thanks DSF - I will try it on my .com webhost. Hopefully it will work
--
Posted: 2004-09-21 18:52:52
Edit :
Quote
no problem
Good luck
--
Posted: 2004-09-22 23:38:04
Edit :
Quote
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
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
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
It worked
Thank you
--
Posted: 2004-09-23 12:56:08
Edit :
Quote
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
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
New Topic
Reply