note 114979 deleted from function.header by cmb
| From: | cmb@php.net | Date: | Sat, 15 Aug 2015 11:44:26 +0000 |
| Subject: | note 114979 deleted from function.header by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203353@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
This is a simple function that you can use in many places if you need redirections:
<?php
function redirect($link=false){
if(!empty($link))
if(!headers_sent())
return header('Location: '.trim($link);
else die('ERROR: Header data not send! Redirecting page is impossible! Contact System
Administrator!');
else return false;
}
// EXAMPLE:
redirect("http://www.php.net")
?>