How can I get the url of a site using php, i.e. the http://www.stuff when I don't know where the site is going to be put. Is there a function that returns the address where the site is residing?
take a look at the $_SERVER array
$_SERVER['PHP_SELF'] will give path of the executing file