LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 09-20-2003, 03:04 PM   #1
HappyDude
Member
 
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 "www.something.com" and then PHP would print "Your are on something.com". I know its possible, but how?
 
Old 09-20-2003, 03:19 PM   #2
Saraev
Member
 
Registered: Apr 2002
Location: Los Gatos, CA
Distribution: boring redhat 9
Posts: 163

Rep: Reputation: 30
<?php echo $_SERVER["PHP_SELF"] ;?> will give you www.domainname.com/pagename.php

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

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


Reply


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 01:06 PM.

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