I am using the following function to get my server URL :
/* get url parameters */
function url() {
return sprintf(
"%s://%s%s", isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', $_SERVER['SERVER_NAME'], $_SERVER['REQUEST_URI']
);
}
The following is my url :
http://enunua.com/emarps/recover_password.php
From the above url , I want only the following parameters as part of my url :
http://enunua.com/emarps/
that is excluding recover_password.php but the above function gives me the whole url inclusive of recover_password.php, Please advise how can I be able to get only : http://enunua.com/emarps/ ?