Jump to content


Get Page URL


3 replies to this topic

#1 _*Joel@JHD_*

  • Guests

Posted 18 July 2005 - 06:58 PM

In PHP how do you get the page URL? thanks

#2 adam123

    Retired P2L Staff

  • Members
  • PipPipPipPip
  • 2,306 posts
  • Location:London, UK
  • Interests:Programming and stuff.

Posted 19 July 2005 - 01:53 AM

<?php

echo $_SERVER['PHP_SELF'];

?>

Is the simple way to get the page name.

#3 _*Joel@JHD_*

  • Guests

Posted 19 July 2005 - 08:45 AM

thanks...i was lookin my books and stuff but couldnt find it...thanks

#4 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 19 July 2005 - 12:16 PM

If you want the full url (minus the domain + the query string), then you'd want to do this;
$_SERVER['REQUEST_URI'];






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users