title: How to properly set a baseurl on localhost
body: <p>I have a php file <strong>verify.php</strong> in a folder called <strong>emailtest</strong> on localhost. I'm implementing an email verification script. But i'm having issues with the activation url that is emailed after registration. Take a look:</p>
  
  <pre><code>define("BASE_PATH", dirname('http://localhost:8888/'))
  
  $url = BASE_PATH . '/emailtest'.'/verify.php?email=' . urlencode($email) . "&amp;key=$encode";
  </code></pre>
  
  <p>In the email sent, i'm getting a link that looks like this(which is unopenable):</p>
  
  <pre><code>    `"http:/emailtest/verify.php?email=lexon4ril%40yahoo.com&amp;key=58a9a..."`
  </code></pre>
  
  <p>But what i really want is this</p>
  
  <pre><code>`http:localhost:8888/emailtest/verify.php?email=lexon4ril%40yahoo.com&amp;key=58a9a...`
  </code></pre>
  
  <p>How can i properly set the url.?</p>
  
  <p><strong>UPDATE</strong>
  Just for future reference i mistyped the link, should be:</p>
  
  <pre><code>`http://localhost:8888//emailtest/verify.php?email=lexon4ril%40yahoo.com&amp;key=58a9a...`
  </code></pre>