Quantcast
Channel: Must Be Built
Viewing all articles
Browse latest Browse all 15

Getting Path Information with PHP

$
0
0
Given a true path of: PHP Output Notes $_SERVER['DOCUMENT_ROOT']; /var/www true document root $_SERVER['HTTP_HOST'] www.mustbebuilt.co.uk Host name $_SERVER['PHP_SELF'] /stuff/more/file.php Path of current file So combining $_SERVER['HTTP_HOST'] with $_SERVER['PHP_SELF'] would get the full path to the file ie: PHP Output $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; www.mustbebuilt.co.uk/stuff/more/file.php The pathinfo() method can then be used to return an associate array of useful(...)

Viewing all articles
Browse latest Browse all 15

Trending Articles