BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 03-03-2009, 09:50 PM   #1 (permalink)
New Member
 
Join Date: Jan 2009
Model: 8330
PIN: N/A
Carrier: Verizon Wireless
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP Anyone?

Please Login to Remove!

I have an issue I can't seem to find a simple answer for. What I am trying to do is do a php page to redirect just BB to a mobile site since by default the come with java and css shut off. The code is very simple but for some reason it will not detect a BB device. All browsers get redirected to index.htm

PHP Code:
<?php
$main
="index.htm";
$mobile="mobile.htm";
if(
$_SERVERxxx91;'USER_AGENT'xxx93;=='BlackBerry')
{
header("location: $mobile");
}
else
{
header("location: $main");
}
?>
Is there not a simple way to do this?
Offline  
Old 03-04-2009, 01:01 AM   #2 (permalink)
New Member
 
squish101's Avatar
 
Join Date: Feb 2009
Location: Singapore
Model: 9000
PIN: 256908AB
Carrier: M1
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jbrill1012 View Post
I have an issue I can't seem to find a simple answer for. What I am trying to do is do a php page to redirect just BB to a mobile site since by default the come with java and css shut off. The code is very simple but for some reason it will not detect a BB device. All browsers get redirected to index.htm

PHP Code:
<?php
$main
="index.htm";
$mobile="mobile.htm";
if(
$_SERVERxxx91;'USER_AGENT'xxx93;=='BlackBerry')
{
header("location: $mobile");
}
else
{
header("location: $main");
}
?>
Is there not a simple way to do this?

will this help?

if ((strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry')) !== false)
{
// set mobile skin
}
Offline  
Old 03-04-2009, 07:41 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: Curve
PIN: N/A
Carrier: Bell
Posts: 20
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jbrill1012 View Post
I have an issue I can't seem to find a simple answer for. What I am trying to do is do a php page to redirect just BB to a mobile site since by default the come with java and css shut off. The code is very simple but for some reason it will not detect a BB device. All browsers get redirected to index.htm

PHP Code:
<?php
$main
="index.htm";
$mobile="mobile.htm";
if(
$_SERVERxxx91;'USER_AGENT'xxx93;=='BlackBerry')
{
header("location: $mobile");
}
else
{
header("location: $main");
}
?>
Is there not a simple way to do this?

I would have done

if(substr_count(strtolower($_SERVER['USER_AGENT']), "blackberry") != 0) {
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 10178557 ALTAIR 4XR Multigas Detector (LEL, O2, CO2, H2S) with Bluetooth
$1519.14
MSA 10178557 ALTAIR 4XR Multigas Detector (LEL, O2, CO2, H2S) with Bluetooth  pictureMSA ALTAIR 5X Multi-Gas Detector 5-GAS (Color Display) LEL,O2,CO,H2S,SO2
$1940.0
MSA ALTAIR 5X Multi-Gas Detector 5-GAS (Color Display) LEL,O2,CO,H2S,SO2 pictureMSA 10092523 Oxygen Altair Single Gas Detector Technology (O2)
$69.99
MSA 10092523 Oxygen Altair Single Gas Detector Technology (O2) pictureMSA Altair O2 Oxygen Single Gas Detector Mfg# 10092523C
$89.99
MSA Altair O2 Oxygen Single Gas Detector Mfg# 10092523C pictureMSA ALTAIR Gas Detecto
$99.99
MSA ALTAIR Gas Detecto picture






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