icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » What URL?

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old September 9th, 2004, 2:16 PM   #1 (permalink)
minor deity
Super #1
 
Bigjohn's Avatar
 
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,395 posts
Gave thanks: 28
Thanked 94 times
What URL?

Situation -

client has parked domains (main=.com, plus .net / .org).

How, with PHP, do I detect which URL the site visitor is coming to the site through?

He wants to echo to the customer "Thanks for coming to MYSITE.COM" if the guest comes via http://mysite.com.

He wants to echo to the customer "Thanks for coming to MYSITE.ORG" if the guest uses http://mysite.org

Etc.

See what I'm trying to do? It should be possible.. but I don't know how...

John
__________________
Proud to be a Surmunity Mod!
XEON PASS60 PASS61
Make a fundamental difference!
My Sites:
Curious about Brewing Beer? Join the community!
>>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax
Get into an Art museum
Victorian London
It's your brain -ON WEB - mybrainhost.com (under development)
What SHOULD Government do? Much Less than it Does!
Bigjohn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 9th, 2004, 3:49 PM   #2 (permalink)
I admire kayla
On a golden path...
 
Joined in Aug 2003
Lives in Saint Petersburg, Florida
Hosted on VPS5
478 posts
Gave thanks: 1
Thanked 1 Time in 1 Post
It is possible, let me look into my php bible holdup..
__________________
“The object of war is not to die for your country, but to make some other bastard die for his.” -George Patton
VPS5
Unleashed2k is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 9th, 2004, 6:15 PM   #3 (permalink)
Peaches!
Excelling Contributor
 
Joined in Jul 2003
Lives in Ottawa, Ontario, Canada
Hosted on Jose, Pass19
564 posts
Gave thanks: 0
Thanked 0 times
PHP to detect what site?
AlexH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 9th, 2004, 6:48 PM   #4 (permalink)
sam
Surpass Fan
Super #1
 
sam's Avatar
 
Joined in Dec 2003
Lives in NJ
5,057 posts
Gave thanks: 0
Thanked 4 times
These looks like the same thread to me.

by the way....

could it not just be

echo ( somestringmanipulationfunction($_SERVER['HTTP_HOST']));

without the if? that way it just works now and forever.
sam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 9th, 2004, 7:18 PM   #5 (permalink)
Peaches!
Excelling Contributor
 
Joined in Jul 2003
Lives in Ottawa, Ontario, Canada
Hosted on Jose, Pass19
564 posts
Gave thanks: 0
Thanked 0 times
Yea but I have a tendency to code things more complicated than they really are.
__________________
alex.honeywell [ seigousei.net - pass19, binuweb.com - jose ]
AlexH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 9th, 2004, 7:27 PM   #6 (permalink)
sam
Surpass Fan
Super #1
 
sam's Avatar
 
Joined in Dec 2003
Lives in NJ
5,057 posts
Gave thanks: 0
Thanked 4 times
No worries
sam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 9th, 2004, 7:49 PM   #7 (permalink)
Registered User
Fresh Surpasser
 
Joined in Aug 2004
2 posts
Gave thanks: 0
Thanked 0 times
PHP Code:
<?php echo "Thanks for coming to $HTTP_HOST.";?>
That will work.
murcoweb is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 9th, 2004, 8:05 PM   #8 (permalink)
Peaches!
Excelling Contributor
 
Joined in Jul 2003
Lives in Ottawa, Ontario, Canada
Hosted on Jose, Pass19
564 posts
Gave thanks: 0
Thanked 0 times
Eww, you used $HTTP_HOST. Never use it that way, ugly ugly. Only do that if you've done something like $HTTP_HOST = $_SERVER['HTTP_HOST'];
__________________
alex.honeywell [ seigousei.net - pass19, binuweb.com - jose ]
AlexH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 9th, 2004, 8:13 PM   #9 (permalink)
Registered User
Fresh Surpasser
 
Joined in Aug 2004
2 posts
Gave thanks: 0
Thanked 0 times
What's wrong with it, it works doesn't it? And if that is all the code on the page, why not use it, it is clean and simple.
murcoweb is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On