how to get the base url?
<p>How can I get the exact base url? for example:</p>

<p>if the user type like this: <a href="http://stackoverflow.com/">http://stackoverflow.com/</a> I have to get the same also and if like this:  <a href="http://www.stackoverflow.com/">http://www.stackoverflow.com/</a>. i have to get the same url also.</p>

<p>thanks in advance</p>
