Getting Path Information with PHP

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…

Read More

How do you function?

Javascript functions can be written in a number of different ways. Function declarations Firstly we have the ‘classic’ named function: This technique is known as a ‘function declaration’. JSFIDDLE Demo Function Expressions Then we have the anonymous function: The above function has no name and is associated with an event. This technique is a type…

Read More