note 52206 added to function.header
| From: | Oto | Date: | Sun, 24 Apr 2005 12:40:49 +0000 |
| Subject: | note 52206 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88488@lists.php.net to get a copy of this message | ||
I have a page that should also be used for mobile devices. So i have hade some throubles. I wrote
this script for detection and redirection using header.
function Embended(){ /* Function for detection */
$out = false;
$STREZNIK = strtoupper($_SERVER['HTTP_USER_AGENT']);
if(eregi('NOKIA',$STREZNIK)) $out = true;
if(eregi('MOT',$STREZNIK)) $out = true;
if(eregi('SEC-',$STREZNIK)) $out = true;
if(eregi('PHONE',$STREZNIK)) $out = true;
if(eregi('PANASONIC',$STREZNIK)) $out = true;
if(eregi('SEC-',$STREZNIK)) $out = true;
if(eregi('PPC',$STREZNIK)) $out = true;
if(eregi('SIEMENS',$STREZNIK)) $out = true;
if(eregi('MITSU',$STREZNIK)) $out = true;
if(eregi('PORTALMMM',$STREZNIK)) $out = true;
if(eregi('BLACKBERRY',$STREZNIK)) $out = true;
if(eregi('SYMBIAN',$STREZNIK)) $out = true;
if(eregi('PHILIPS',$STREZNIK)) $out = true;
if(eregi('SENDO',$STREZNIK)) $out = true;
if(eregi('KLONDIKE',$STREZNIK)) $out = true;
if(eregi('SAGEM',$STREZNIK)) $out = true;
if(eregi('MOBILE',$STREZNIK)) $out = true;
if(eregi('ALCATEL',$STREZNIK)) $out = true;
if(eregi('SONY',$STREZNIK)) $out = true;
return $out;
};
/* Redirection with header to mobile page */
if(Embended()){ header("Location: zooxMobile.php"); };
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52206
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52206&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52206&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52206&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52206&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52206&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52206&report=yes
Search -- http://master.php.net/manage/user-notes.php