Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-23-2003, 03:51 AM   PM User | #1
soccerdvy
New Coder

 
Join Date: Jul 2003
Location: Angier, NC
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
soccerdvy is an unknown quantity at this point
Showing Server IP address

I am working on a new hobby site, and I would like to have it show (at the top) (persons_username)@(server_ip_address). Where the respective blanks are filled in with the respective entries based on the person who is at the site and the current IP of the server. Is there any way that I could have PHP display the server's IP address? Thanks in advance for anyone who reads this.
__________________
No matter what happens, someone will find a way to take it too seriously -- Joe Davy

www.axiscreations.com
soccerdvy is offline   Reply With Quote
Old 11-23-2003, 03:57 AM   PM User | #2
meediake
New Coder

 
Join Date: Nov 2003
Location: PHP-LAND
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
meediake is an unknown quantity at this point
<?
$servername=gethostbyaddr($yourIP);
?>
meediake is offline   Reply With Quote
Old 11-23-2003, 06:35 AM   PM User | #3
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
<?php echo $_SERVER['REMOTE_ADDR'];?>
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Old 11-23-2003, 02:19 PM   PM User | #4
ReadMe.txt
Regular Coder

 
Join Date: Jun 2002
Location: Sheffield, UK
Posts: 552
Thanks: 0
Thanked 0 Times in 0 Posts
ReadMe.txt is an unknown quantity at this point
are you wanting the IP of the visitor or, as you said, the server?

for the server you can use $_SERVER['SERVER_ADDR'] or firepage's code form above for the visitor's IP
__________________
"To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

(Me Me Me Me Me Me Me Me Me)
ReadMe.txt is offline   Reply With Quote
Old 11-23-2003, 05:24 PM   PM User | #5
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
doh sorry , I just assumed Visitor IP , I must be getting old
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Old 11-23-2003, 08:25 PM   PM User | #6
soccerdvy
New Coder

 
Join Date: Jul 2003
Location: Angier, NC
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
soccerdvy is an unknown quantity at this point
thanks everybody! this is my favorite forum!
__________________
No matter what happens, someone will find a way to take it too seriously -- Joe Davy

www.axiscreations.com
soccerdvy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

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

Forum Jump


All times are GMT +1. The time now is 03:46 PM.


Advertisement
Log in to turn off these ads.