All links in Magento should be generated via url model. Here is simple examples working in backend.
$url = Mage::getModel('adminhtml/url'); $url->setControllerName('adminhtml_settings'); $url->setActionName('action'); echo $url->getUrl();
This will produce full url like:
Where MODEL is model name which you are using, controller and action is generated via model and finally – if there is a existing secure key, will be created in url.