Site Cloner PHP Script
Bargain Hunter PHP Script
Job Hunter PHP Script
Site Login and Access Control PHP Script

Using PHP to redirect pages based on browser can make life simpler in some circumstances. The following samples below show various redirects for various browers.

if(preg_match(“/opera/i”,$_SERVER[‘HTTP_USER_AGENT’]))
die(header(“Location: http://getfirefox.com”));
?>
 
<?php
if(preg_match(“/chrome/i”,$_SERVER[‘HTTP_USER_AGENT’]))
die(header(“Location: http://getfirefox.com”));
?>
 
<?php
if(preg_match(“/safari/i”,$_SERVER[‘HTTP_USER_AGENT’]))
die(header(“Location: http://getfirefox.com”));
?>
 
<?php
if(preg_match(“/MSIE/i”,$_SERVER[‘HTTP_USER_AGENT’]))
die(header(“Location: http://getfirefox.com”));
?>
 
<?
$redirect=”http://www.redirecturlputhere.net”;
if(preg_match(‘/Firefox/’,$_SERVER[‘HTTP_USER_AGENT’]))!
=1) header(“Location: “.$redirect);
?>