1
2
3
4
5
6
7
8
| // Returns the current page.
function getPageURL(){
return 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
}
// getCurrDir() returns the current directory.
function getCurrDir(){
return dirname( getPageURL() );
} |
// Returns the current page.
function getPageURL(){
return 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
}
// getCurrDir() returns the current directory.
function getCurrDir(){
return dirname( getPageURL() );
}
Example:
1
2
| getPageURL(); // returns "http://localhost/live/uploadProductImage.php"
getCurrDir(); // returns "http://localhost/live/" |
getPageURL(); // returns "http://localhost/live/uploadProductImage.php"
getCurrDir(); // returns "http://localhost/live/"