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





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