Reputation: 1145
//Grab and assign List ID from confirmation URL
$L = $_GET["L"];
//Set Redirects based on List ID
if($L == "1") {
header("Location: http://stat.domain.com/");
exit();
}
This is the content of a redirection rule that I have created, but I am thinking of putting these in a separate file instead of the master file MASTER.php. I was reading online and there are different ways of reading the content off a separate file, of which are functions like include() include_once(). However, after reading through some information online, i am still not very sure what i should do to include the above content in the master file.
Any efficient way of doing this?
Upvotes: 0
Views: 184
Reputation: 20431
You only want to include that file once in a certain place. Perhaps add an include to redirects.php
from master.php
:
require_once 'redirects.php';
You could also use include_once
, but that will not halt the script if the file cannot be found and will fail silently - which is usually much worse than explicitly.
Upvotes: 1