PHP: How to redirect a visitor

Posted on May 21, 2008, Filled under PHP,  Bookmark it

This function will redirect the visitor to a specific location.

<?php
function go($location)
{
header("Location: ".$location);
exit;
}

// Location
$location = 'http://www.google.com/';

// Redirect the visitor
go($location);
?>

Do you wish to receive the latest updates as soon as they are posted? Get our RSS Feed or Subscribe to the Newsletter!

Get our RSS Feed!

Sponsors

Related Posts

Leave a Reply


* = required fields

(will not be published)


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


  

CommentLuv Enabled