BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 03-03-2009, 10: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, 02: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, 08: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

Honeywell Xeon 1900 2USB Barcode Scanner
$89.99
Honeywell Xeon 1900 2USB Barcode Scanner pictureQty 2 Dell Poweredge 1950 Servers w/ Nortel CCMS CCMA Contact Center Management
$1079.1
Qty 2 Dell Poweredge 1950 Servers w/ Nortel CCMS CCMA Contact Center Management pictureSUPERMICRO X7DBE+ 2X XEON 5050 CPU 8GB MEMORY SERVER MOTHER BOARD
$250.0
SUPERMICRO X7DBE+ 2X XEON 5050 CPU 8GB MEMORY SERVER MOTHER BOARD pictureSUPERMICRO X7DBU 2X XEON X5355 CPU 16GB MEMORY SERVER MOTHER BOARD
$250.0
SUPERMICRO X7DBU 2X XEON X5355 CPU 16GB MEMORY SERVER MOTHER BOARD pictureNASUNI FILER NF-400 DELL POWEREDGE R620 7.2 TB 32GB RAM Intel Xeon E5-2609 X 2
$2995.0
NASUNI FILER NF-400 DELL POWEREDGE R620 7.2 TB 32GB RAM Intel Xeon E5-2609 X 2  picture






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