How to redirect to another page using php

Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to redirect to another page using php

Post by Saman » Fri Jul 15, 2011 6:32 pm

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"); 
 
?>
Post Reply

Return to “PHP & MySQL”