//include_once('includes/my_include_file.php'); //Get the name of the file calling this include $calling_file = end(explode('/', $_SERVER[‘PHP_SELF’])); switch ($calling_file) { case 'some_file.php':
Category: URL’s
Get Page URI / URL
Get just the domain name $_SERVER[‘HTTP_HOST’] gives you the domain name through which the current request is being fulfilled Get site URL Get full page URL (domain name + page + any arguments) Page URL (With Arguments) Stripping Page URL Get URL without the domain name Getting URL without the arguments Getting just the URL […]
Getting Site URL
See also: /php/page-control/get-page-uri-url Getting Site URL
Getting URL Arguments
Get an argument GET only using $_GET POST only using $POST GET or POST using $_REQUEST Did GET or POST occur Example GET URL Start with an ‘?’, then separate other values with an ‘&’ To read: Example For POST Parameters Sanitise Them!!! htmlentities() converts things like < > ” \ etc into HTML strings like […]
Site Root
You can’t do this in php: require_once ‘/s3_settings.php’; So instead do this: require_once($_SERVER[‘DOCUMENT_ROOT’] . ‘/s3_settings.php’);
