Posted By

webkitvn on 06/05/13


Tagged

page current


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

IMPGTX


Get current page


 / Published in: PHP
 

Get current page

  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. }

Report this snippet  

You need to login to post a comment.