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

13.3 Inch windows 10 Laptop Notebook In-tel 5th gen. i5 Dual Core 4GB RAM 128GB
$700.8
13.3 Inch windows 10 Laptop Notebook In-tel 5th gen. i5 Dual Core 4GB RAM 128GB  picture10PCS X24C44ST1 Encapsulation:SOP-8,Serial Nonvolatile Static RAM
$10.42
10PCS X24C44ST1  Encapsulation:SOP-8,Serial Nonvolatile Static RAM picture5PCS X24C44ST1 Encapsulation:SOP-8,Serial Nonvolatile Static RAM
$6.25
5PCS X24C44ST1  Encapsulation:SOP-8,Serial Nonvolatile Static RAM picture1PCS X24C44ST1 Encapsulation:SOP-8,Serial Nonvolatile Static RAM
$1.67
1PCS X24C44ST1  Encapsulation:SOP-8,Serial Nonvolatile Static RAM pictureMicros Pos E7 WS5, Ram Upgrade 2Gig, 4.0 Software, Manuals
$749.0
Micros Pos E7 WS5, Ram Upgrade 2Gig, 4.0 Software, Manuals picture






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