Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-20-2003, 03:04 PM   #1
Registered: Jul 2003
Posts: 140

Rep: Reputation: 15
PHP Url?

Can PHP figure out the url of the webpage I'm on? Suppose I was on page "" and then PHP would print "Your are on". I know its possible, but how?
Old 09-20-2003, 03:19 PM   #2
Registered: Apr 2002
Location: Los Gatos, CA
Distribution: boring redhat 9
Posts: 163

Rep: Reputation: 30
<?php echo $_SERVER["PHP_SELF"] ;?> will give you

<?php echo $_SERVER["SERVER_NAME"];?> will give you the name of the apache server, for example.
Old 09-20-2003, 04:20 PM   #3
Registered: Jul 2003
Posts: 140

Original Poster
Rep: Reputation: 15
YAY! Thank you.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing URL in PHP benrose111488 Programming 6 10-12-2005 12:12 PM
how to use php open and url antony_csf Programming 7 09-27-2004 12:54 AM
Getting the url with PHP linux_pioneer Linux - General 2 06-20-2004 02:08 PM
# URL variable in PHP fatman Programming 1 06-04-2004 10:42 PM
Can you verify a url with php? digitalgravy Programming 4 03-01-2004 01:38 PM

All times are GMT -5. The time now is 07:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration