PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 28th, 2003, 03:07 PM
llafond llafond is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 2 llafond User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy New PHP Coder Question

I am trying to use PHP to determine what web server I am on.

I have a web page on my machine using IIS and upload it to the site as well. The Page uses some Graphics that are only on the Web.

I'd like to have my page determine that it is using "localhost" vs. "http://www.domainname.com" .

How do I get the Server Name (or what I need) and determine it to be my IIS or the Web?

Remember, I'm new to PHP.

Thanx,
Lou

Reply With Quote
  #2  
Old February 28th, 2003, 03:56 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 16
Quote:
I'd like to have my page determine that it is using "localhost" vs. "http://www.domainname.com"


You can use the server var(s) to determine that->

PHP Code:
if ( stristr$_SERVER['HTTP_HOST'], 'localhost' ) ) {
echo 
'It is being ran locally';
} else {
echo 
'being ran by remote machine';

__________________
~ Joe Penn

We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?

Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.




Reply With Quote
  #3  
Old February 28th, 2003, 04:12 PM
llafond llafond is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 2 llafond User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Thanx - More Information?

Thanx for the Code.

Is there a referance site that I can get more information about Server Var's?

And Other Topics?

Tutorials?

If you can, Please Let me know....

Thanx,
Lou

Reply With Quote
  #4  
Old February 28th, 2003, 05:54 PM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 366 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 59 sec
Reputation Power: 16
__________________
-- Jason

Reply With Quote
  #5  
Old February 28th, 2003, 06:25 PM
infamous-online infamous-online is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 403 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 27 m 25 sec
Reputation Power: 17
Wink Re: New PHP Coder Question

Quote:
Originally posted by llafond
I am trying to use PHP to determine what web server I am on.

I have a web page on my machine using IIS and upload it to the site as well. The Page uses some Graphics that are only on the Web.

I'd like to have my page determine that it is using "localhost" vs. "http://www.domainname.com" .

How do I get the Server Name (or what I need) and determine it to be my IIS or the Web?

Remember, I'm new to PHP.

Thanx,
Lou


heres a small program that can tell you what you need to know. it's called id serve to download it go here http://grc.com/files/IDServe.exe and to get a brief description of this software http://grc.com/id/idserve.htm

hope this helps
__________________
Apache Expert

Reply With Quote
  #6  
Old March 3rd, 2003, 02:26 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 785 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 16
Re: Thanx - More Information?

Quote:
Originally posted by llafond
Thanx for the Code.

Is there a referance site that I can get more information about Server Var's?

And Other Topics?

Tutorials?

If you can, Please Let me know....

Thanx,
Lou


http://www.php.net/manual/tw/langua...es.superglobals
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > New PHP Coder Question


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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 not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap