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

LOT OF TWO Heavy Duty Toggle Switch GB Electrical GSW-121
$10.95
LOT OF TWO Heavy Duty Toggle Switch  GB Electrical GSW-121 pictureSTEVECO 90-340 Universal Magnetic AC Switching Relay 24VAC COIL DPDT NEW
$11.95
STEVECO 90-340 Universal Magnetic AC Switching Relay 24VAC COIL DPDT NEW pictureStahl ex multi switch 8030/51-035
$149.0
Stahl ex multi switch 8030/51-035 pictureGenuine Case Wheel Loader Work Light Switch , Case 621 , Case 721 , A187870
$7.0
Genuine Case Wheel Loader Work Light Switch , Case 621 , Case 721 , A187870 picturePOWERTEC 71008 110/220V Single Phase On/Off Switch
$15.08
POWERTEC 71008 110/220V Single Phase On/Off Switch picture






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