PHP - Moved: Drop Down Redirect
This topic has been moved to JavaScript Help.
http://www.phpfreaks.com/forums/index.php?topic=313821.0 Similar TutorialsThis topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=308147.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=327302.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=359561.0 This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=342523.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=358276.0 This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=353375.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=315834.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=325383.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=357107.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=359577.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=306771.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=316053.0 This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=355870.0 This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=316303.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=321418.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=341998.0 This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=317833.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=310879.0 I'm trying to put together a script that redirects visitors based on their IP, user agent and/or referral url. Basically I want the script to scan these three factors from the visitor, if any of them turn out to match my redirect-requirement it redirects the user. I know the code is horribly coded, I'm incredibly new to the php-scene and consider myself a complete noob. As you can see I want redirected visitors to go to google.com and un-redirected to msn.com(examples). Really thankful for all the help I can get! Right now nothing works, any suggestions? <?php function redirect($page) { Header( "HTTP/1.1 301 Moved Permanently" ); header('Location: ' . $page); exit; } $referrals=array('pitchingit.org','referral2'); $badAgents = array("useragent1", "useragent2"); $deny = array("78.105.191..*","100.101.103..*"); if (in_array($_SERVER['HTTP_REFERER'], $referrals, FALSE)) { header("Location: http://www.google.com"); } else { header("Location: http://www.msn.com"); } if(in_array($_SERVER['HTTP_USER_AGENT'],$badAgents)) { redirect("http://www.google.com/"); exit(); } $add=$_SERVER['REMOTE_ADDR']; foreach ($deny as $ip) { if (preg_match("^.$add.*^",$ip)) { redirect("http://www.google.com"); } } redirect("http://www.msn.com"); ?> How can one re-direct a visitor, without using a header re-direct? I'd like a page to show up, then after about 5 seconds I need the visitor sent to another page. How can I do this? |