please help not working

Started on the old forum in July 2011 · view the original in the archive · old links redirect here

3 replies · 442 views · started 15 years ago · 1 min read

4 participants
jsyguy23 Developer · 134 posts #1

not sure whats wrong with this but its not working

<?php
header('Content-Type: text/html;charset=utf-8');

$http=$_SERVER['HTTP_USER_AGENT'];
if((substr($http,0,5)=='Opera' and !strpos($http,'Mini')) 
or substr($http,0,7)=='Mozilla' 
or substr($http,0,6)=='Galaxy' 
or substr($http,0,12)=='AmigaVoyager' 
or substr($http,0,8)=='CyberDog' 
or substr($http,0,5)=='Dillo' 
or substr($http,0,7)=='HotJava' 
or substr($http,0,15)=='IBM WebExplorer' 
or substr($http,0,4)=='iCab' 
or substr($http,0,10)=='LeechCraft' 
or substr($http,0,5)=='Links' 
or substr($http,0,4)=='Lynx' 
or substr($http,0,11)=='NCSA Mosaic' 
or substr($http,0,7)=='NCSA Mosaic' 
or substr($http,0,6)=='retawq' 
or substr($http,0,6)=='Webkit' 
or substr($http,0,4)=='Uzbl' 
or substr($http,0,3)=='w3m' 
or substr($http,0,12)=='WorldWideweb')
{
header("Location: http://$_SERVER[SERVER_NAME]/index.html"); //pc
}else{
header("Location: http://$_SERVER[SERVER_NAME]/index.php"); //mobile
}
?>
mobidev Senior · 312 posts #2

Its suppose to be a browser detect script. By what I can see its not going to be doing anything else than that and then redirect to a mobile or pc version of ur site meaning u have to have a PC version an mobile version of your site...

mFreak Developer · 66 posts #3

so which error is it reporting??? and why dont you use strpos instead of substr,its easier and do the same work???

$("#mfreak").find(".head brain").clone();

Progress:

[|||___________________________] : 5%

Output:

Memory limit reached, unable to complete operation.

Support answer:

Try using a super uber strong mega computer to reach at least 10%.

👋

arnage Lead · 811 posts #4

Here

<?php
header('Content-Type: text/html;charset=utf-8');

$http=$_SERVER['HTTP_USER_AGENT'];
if((substr($http,0,5)=='Opera' and !strpos($http,'Mini')) 
or substr($http,0,7)=='Mozilla' 
or substr($http,0,6)=='Galaxy' 
or substr($http,0,12)=='AmigaVoyager' 
or substr($http,0,8)=='CyberDog' 
or substr($http,0,5)=='Dillo' 
or substr($http,0,7)=='HotJava' 
or substr($http,0,15)=='IBM WebExplorer' 
or substr($http,0,4)=='iCab' 
or substr($http,0,10)=='LeechCraft' 
or substr($http,0,5)=='Links' 
or substr($http,0,4)=='Lynx' 
or substr($http,0,11)=='NCSA Mosaic' 
or substr($http,0,7)=='NCSA Mosaic' 
or substr($http,0,6)=='retawq' 
or substr($http,0,6)=='Webkit' 
or substr($http,0,4)=='Uzbl' 
or substr($http,0,3)=='w3m' 
or substr($http,0,12)=='WorldWideweb')
{
header('Location: http://'.$_SERVER['SERVER_NAME'].'/index.html'); //pc
}else{
header('Location: http://'.$_SERVER['SERVER_NAME'].'/index.php'); //mobile
}
?>
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close