Page 1 of 1

How to redirect to another page using php

Posted: Fri Jul 15, 2011 6:32 pm
by Saman
If you want a PHP redirect script that redirects visitors from a page to a specific URL then this is it. It sends the user from one web page to a different web page address. It is a good alternative to using the meta tag http-equiv option.

Code: Select all

<?php 
 
/** 
 * Place in a blank PHP page 
 */ 
 
// Change to the URL you want to redirect to 
$URL="http://www.example.com"; 
 
header ("Location: $URL"); 
 
?>