i need a redirect script where just say im on pc or on my phone i goto http://blahblah.com it will redirect to web site if im on pc and to wap if in on my mobile?.. anyone got this? thanks
Redirect Script...
Collapse
X
-
i think this very good
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
/**
*
* @package Multi Direct
* @version 1.00 BETA 2006/12/02 12:30:00 devianceX
* @copyright © 2001-2006 devianceX
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
*/
//EDIT BELOW
//your web url
$WEB_URL = 'http://wapforum.uk.to/';
//your wap 1.0 url
$WAP_URL = 'http://wapforum.uk.to/wap/';
//url for wap 2.0 and similar html and wml compatible browsers
$BOTH_URL = 'http://wapforum.uk.to/archive/';
//a url to redirect strange or unrecognized browsers, its very unlikely this will be needed
$MMM_URL = 'http://wapforum.uk.to/';
//DO NOT EDIT BELOW THIS LINE UNLESS YOUR EXPERIENCED IN PHP
//if browser does NOT accept wml then html variable is true
if ((eregi ("text/vnd.wap.wml", $HTTP_ACCEPT)) != true)
{
$HTML = 'TRUE';
}
//lets see if wml is true also or if its a pure web browser
if ((eregi ("text/html", $HTTP_ACCEPT)) != true)
{
$WML = 'TRUE';
}
//if wml AND html are true it must be wap 2.0 phone and we should direct to html lo-fi (or give a choice)
if ($HTML='TRUE' AND $WML='TRUE' AND $S60='FALSE')
{
//both wml and html set true
$BOTH = 'TRUE';
}
//if wml and html true
if ($BOTH='TRUE')
{
//redirect to both url
//exit
header("Location: $BOTH_URL");
exit;
}else
{
//if wml is true
if ($WML='TRUE')
{
//redirect to wap url
//exit
header("Location: $WAP_URL");
exit;
}else
{
//if web is true
if ($WEB='TRUE')
{
//redirect to web url
//exit
header("Location: $WEB_URL");
exit;
}else
{
//if for some strange reason its not any of the above let it carry on to the web site.. Or is it a bot? Pmpl
//redirect to mmm
//exit
header("Location: $MMM_URL");
exit;
}}}
// END OF REDIRECTION - SCRIPT BY DEVIANCEX
// HTTP://WAPFORUM.UK.TO - THE BEST WAPFORUM
////////////////////////////////
//© 2001-2006 devianceX
////////////////////////////////
?></div>
Comment
-
m8 you are advanced member here and you dont know the posts, parts and scripts on this forum...i need a redirect script where just say im on pc or on my phone i goto http://blahblah.com it will redirect to web site if im on pc and to wap if in on my mobile?.. anyone got this? thanks[/b]
here is example:- <blockquote><?php
- if ((eregi ("htm", $_SERVER['HTTP_ACCEPT'])) == true){ ?>
- <!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta http-equiv="refresh" content="1;url=xhtml.php" />
- <title>ngeo chat</title>
- <link rel="stylesheet" type="text/css" href="style_logo/style.css" />
- </head>
- <body>
- <div align="center">
- Please wait...
Click below if yo do not wish to wait, or your Mobile Phone don 't make the transfer - enter
- </div>
- </body>
- </html>
- <?php
- exit();
- }
- else
- {
- header("Content-type: text/vnd.wap.wml");
- header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
- header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
- header("Cache-Control: no-cache, must-revalidate");
- header("Pragma: no-cache");
- header("Provided-by:ngeo@ngeo.ro");
- echo "<?xml version=\"1.0\"?>
- <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
- ." \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
- ?>
- <wml>
- <card id="ngeo" title="ngeo chat" ontimer="wml.php">
- <timer value="1"/>
- <p align="center">
- Please wait...
Click below if yo do not wish to wait, or your Mobile Phone don 't make the transfer - enter
- </p>
- </card>
- </wml>
- <?php
- exit();
- }
- ?></blockquote>
Comment
-
Guest
easyCode:<?php if ((eregi ("text/vnd.wap.wml", $HTTP_ACCEPT)) != true) { header("Location: http://yoursite.com"); exit; } else { header("Location: http://yoursite.com"); exit; } ?>
Comment

Comment