Posted By

gerhardsletten on 08/23/09


Tagged

php textmate


Versions (?)

PHP Function current url


 / Published in: Other
 

  1. function curPageURL() {
  2. $pageURL = 'http';
  3. if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
  4. $pageURL .= "://";
  5. if ($_SERVER["SERVER_PORT"] != "80") {
  6. $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
  7. } else {
  8. $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
  9. }
  10. return $pageURL;
  11. }
  12. echo curPageURL();

Report this snippet  

You need to login to post a comment.