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 » PHP to detect what site?

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

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old August 27th, 2004, 6:12 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
PHP to detect what site?

Let's say I have 3 domain names registered and I point them all to the same site. Is there a way to display for the visitor certain content specific to the domain name they entered in the URL?

like
http://siteone.net >> displays "welcome to SITEONE.NET"
http://siteone.com >> displays "welcome to SITEONE.COM"

??

Can this be done? How!
__________________
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 August 27th, 2004, 6:19 PM   #2 (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
This should work for you
PHP Code:
<?php if ( strpos($_SERVER['HTTP_HOST'], "siteone.net") ) {
  echo 
"Welcome to SITEONE.NET";
}
else if ( 
strpos($_SERVER['HTTP_HOST'], "siteone.com") ) {
  echo 
"Welcome to SITEONE.COM";
}
?>
__________________
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 August 27th, 2004, 6:36 PM   #3 (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
Quote:
Originally Posted by Alex
This should work for you
PHP Code:
<?php if ( strpos($_SERVER['HTTP_HOST'], "siteone.net") ) {
  echo 
"Welcome to SITEONE.NET";
}
else if ( 
strpos($_SERVER['HTTP_HOST'], "siteone.com") ) {
  echo 
"Welcome to SITEONE.COM";
}
?>
that will detect what URL they hit in the browser? Where do I put that, in the block that I create the header in?
__________________
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 August 27th, 2004, 6:39 PM   #4 (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
Quote:
Originally Posted by Bigjohn
that will detect what URL they hit in the browser? Where do I put that, in the block that I create the header in?
Yea
__________________
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
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