Before few days, while working with magento, we have a requirement to get current page url.
To fulfill our requirement we have searched the web and got proper solution.
And to get current page url we have used under given code:
Same as above code, we can use under given magento code lines to get base url of magento installation, to get url of media directory, to get url of skin directory and to get url of js directory respectively.
Mage::getBaseUrl(); Mage::getBaseUrl('media'); Mage::getBaseUrl('skin'); Mage::getBaseUrl('js');
Hope this will help you.