Created
March 11, 2016 02:01
-
-
Save nishad/e996aac06452684d7242 to your computer and use it in GitHub Desktop.
Simple PHP Redirect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function Redirect($url, $permanent = false) | |
| { | |
| if (headers_sent() === false) | |
| { | |
| header('Location: ' . $url, true, ($permanent === true) ? 301 : 302); | |
| } | |
| exit(); | |
| } | |
| Redirect('http://www.google.com/', false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment