BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 07-27-2008, 03:03 PM   #1 (permalink)
New Member
 
Join Date: Jul 2008
Model: 8800
PIN: N/A
Carrier: Rogers Wireless
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Browser issue?

Please Login to Remove!

Okay, so basically I'm trying to have my php detect the browser and fail if it's anything other than blackberry, or redirect to another page and not complete the remaining code.

I found this:

<?php
$agent = $_SERVER['HTTP_USER_AGENT'];
echo "User agent reported as: " . $agent . "\n";

if (eregi("BlackBerry", $agent)) {
echo "BlackBerry";
}
else {
echo "Not BlackBerry";
}
?>

but the response is all muddled in the blackberrry browser....

any ideas... for some reason i don't think i'm trying to echo,..
Offline  
Old 07-27-2008, 03:29 PM   #2 (permalink)
New Member
 
Join Date: Jul 2008
Model: 8800
PIN: N/A
Carrier: Rogers Wireless
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

this i likely the better code...

but what do i put as the ereg"BlackBerry" ?

<?php
$br = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser they use.

if(ereg("msie", $br)) {
header("location: originalhomepage.php");
} else {
header("location: alteredhomepage.php");
}
?>
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

MSA Altair 4X 10086638 240V Mains multi gas detector Charger
$199.0
MSA Altair 4X 10086638 240V Mains multi gas detector Charger pictureGAS DETECTOR TESTER MSA GALAXY ALTAIR 5 AUTOMATED TEST SYSTEM
$1465.0
GAS DETECTOR TESTER  MSA GALAXY ALTAIR 5 AUTOMATED TEST SYSTEM  pictureMSA altair 4X Monitor detector, O2,H2S,CO,LEL Charger
$320.0
MSA altair 4X Monitor detector, O2,H2S,CO,LEL  Charger pictureMSA altair 4 X multi gas Meter Monitor O2,H2S,CO,LEL + 1 Charger
$330.0
MSA altair 4 X multi gas Meter Monitor O2,H2S,CO,LEL + 1 Charger pictureMSA altair 4X multi gas Meter Monitor detector, O2,H2S,CO,LEL + Cradle.Charger.
$340.0
MSA altair 4X multi gas Meter Monitor detector, O2,H2S,CO,LEL +  Cradle.Charger. picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.