Added UrlDirectory function

primary used to get the current directory from the URL of the page.which can be used in case of async post or get to another page in the same directory.