/ Published in: PHP
URL: http://mark.haktstudios.com/
Simple function to handle HTTP Redirections in a script
Expand |
Embed | Plain Text
// place within index.php // figure out our settings and manipulate variables accordingly $self = 'index.php'; if ( $https !== false ) $site = "https://{$_SERVER['HTTP_HOST']}{$uri}"; else $site = "http://{$_SERVER['HTTP_HOST']}{$uri}"; // define our constant // free up our variables /******************************************************************************/ /* redirect($address) /* /* Redirects your browser to $address /******************************************************************************/ function redirect($address) { // Make sure address is formatted properly if( stripos($address, 'http://') === false && stripos($address, 'https://') === false ) $address = SITE.$address; // redirect }
You need to login to post a comment.
