Display servers current ip in page... possible?

 
Post new topic   Reply to topic    Aprelium Forum Index -> Networking Issues
View previous topic :: View next topic  
Author Message
Mecctro_
-


Joined: 09 Mar 2006
Posts: 18

PostPosted: Mon May 08, 2006 2:54 am    Post subject: Display servers current ip in page... possible? Reply with quote

Is there a script that can display the current ip adress of the server that changes cuz i have dynamic ip?


thnx for your help.
Back to top View user's profile Send private message MSN Messenger
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon May 08, 2006 3:10 am    Post subject: Reply with quote

You can only view the correct IP if you're not in the same network. You should
use Dynamic IP Update client in order to update your IP when it changes. A few
of the DNS services that offer this, are listed below.

http://www.no-ip.com
http://www.dyndns.org
Back to top View user's profile Send private message Visit poster's website
Mecctro_
-


Joined: 09 Mar 2006
Posts: 18

PostPosted: Mon May 08, 2006 3:42 am    Post subject: Reply with quote

sorry I think I need to correctly specify....

I need a webpage to display my servers current ip adress so that people on the internet can view it.

I dont know if there is a way that i can use a tool similar to the no-ip updater tool to make a webpage do this but if i could it would be greatly appreciated.

Hopefully you understand what exactly im asking for... i dont need a dns updater i need a webpage.

Thak you in advance
Mecctro
Back to top View user's profile Send private message MSN Messenger
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Mon May 08, 2006 10:04 am    Post subject: Reply with quote

The SERVER_ADDR environment variable holds the address of the server machine. Try that.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon May 08, 2006 10:36 am    Post subject: Reply with quote

MonkeyNation wrote:
The SERVER_ADDR environment variable holds the address of the server machine. Try that.


This Environment variable doesn't exist (Tested with PHP). :/

Code:
<?php
    echo $_SERVER['SERVER_ADDR'];
?>


Last edited by TRUSTAbyss on Mon May 08, 2006 10:45 am; edited 1 time in total
Back to top View user's profile Send private message Visit poster's website
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Mon May 08, 2006 10:44 am    Post subject: Reply with quote

TRUSTAbyss wrote:
This Environment variable doesn't exist (Tested with PHP). :/


Perhaps it isn't available in Abyss then, although I doubt it.
<?=$_SERVER['SERVER_ADDR']?> gives me 62.193.234.112.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon May 08, 2006 10:46 am    Post subject: Reply with quote

I tried mine using localhost, which didn't return 127.0.0.1 as the server IP.
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue May 09, 2006 10:12 am    Post subject: Reply with quote

TRUSTAbyss wrote:
MonkeyNation wrote:
The SERVER_ADDR environment variable holds the address of the server machine. Try that.


This Environment variable doesn't exist (Tested with PHP). :/

Code:
<?php
    echo $_SERVER['SERVER_ADDR'];
?>

The information that should go in this variable is not very useful. First of all, your computer can have 2 or more IP addresses. To which IP SERVER_ADDR should be set?
Second, if you are behind a router, all you can get are your local and LAN IP addresses, which are useless for the outside visitors.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
abyssisthebest
-


Joined: 30 Jun 2005
Posts: 319
Location: Boston, UK

PostPosted: Tue May 09, 2006 3:01 pm    Post subject: Reply with quote

what you could do is get a mate to host a script:
Code:

<?php
$ip = $_SERVER['REMOTE_ADDR'];
echo $ip;
?>

I think :D

Then all you need to do to get your IP is include("http://thedomain.com/script.php") this should then echo your IP
_________________
My online Portfolio
Back to top View user's profile Send private message Send e-mail MSN Messenger
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Tue May 09, 2006 3:21 pm    Post subject: Reply with quote

aprelium wrote:
The information that should go in this variable is not very useful. First of all, your computer can have 2 or more IP addresses. To which IP SERVER_ADDR should be set?
Second, if you are behind a router, all you can get are your local and LAN IP addresses, which are useless for the outside visitors.


I've never looked through the apache httpd source code (Which I assume is the best idea.), but off the top of my head, resolve the HTTP_HOST header, if possible?

Likewise, you could do this in PHP by using gethostbyname($_SERVER['HTTP_HOST']).
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed May 10, 2006 10:40 am    Post subject: Reply with quote

MonkeyNation wrote:
aprelium wrote:
The information that should go in this variable is not very useful. First of all, your computer can have 2 or more IP addresses. To which IP SERVER_ADDR should be set?
Second, if you are behind a router, all you can get are your local and LAN IP addresses, which are useless for the outside visitors.


I've never looked through the apache httpd source code (Which I assume is the best idea.), but off the top of my head, resolve the HTTP_HOST header, if possible?

Likewise, you could do this in PHP by using gethostbyname($_SERVER['HTTP_HOST']).

Apache fills this variable with the local IP address that was contacted to process the request. So it will contain your LAN IP if you're behind a router.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Tom Chapman
-


Joined: 09 Jul 2005
Posts: 933
Location: Australia

PostPosted: Wed May 10, 2006 10:49 am    Post subject: Reply with quote

What is all the trouble about?

It's really quite simple any of the methods that show a local IP will work for people outside of the Server's LAN, will they not?
Back to top View user's profile Send private message Visit poster's website MSN Messenger
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Wed May 10, 2006 5:44 pm    Post subject: Reply with quote

aprelium wrote:
Apache fills this variable with the local IP address that was contacted to process the request. So it will contain your LAN IP if you're behind a router.


What, like the address of the network interface?
I haven't ever used this variable to my knowlage so I don't really know.

MrWiseOne: If my assumption is correct, then no, it will show the IP of the network adaptor, and will be of no use to most home users.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
Tom Chapman
-


Joined: 09 Jul 2005
Posts: 933
Location: Australia

PostPosted: Wed May 10, 2006 9:56 pm    Post subject: Reply with quote

I must not fully understand the parametres of this problem. May someone please restate them?
Back to top View user's profile Send private message Visit poster's website MSN Messenger
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Wed May 10, 2006 10:27 pm    Post subject: Reply with quote

Problem : You are attempting to answer questions well beyond your skill and experience level.
Solution : Stop.

Clear enough? :roll:
_________________

"Invent an idiot proof webserver and they'll invent a better idiot..."
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Wed May 10, 2006 10:40 pm    Post subject: Reply with quote

Anonymoose wrote:
Problem : You are attempting to answer questions well beyond your skill and experience level.
Solution : Stop.

Clear enough? :roll:


I agree. If you have no feasable answer because you cant understand it, do not post to begin with.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu May 11, 2006 10:05 am    Post subject: Reply with quote

MonkeyNation wrote:
aprelium wrote:
Apache fills this variable with the local IP address that was contacted to process the request. So it will contain your LAN IP if you're behind a router.


What, like the address of the network interface?
I haven't ever used this variable to my knowlage so I don't really know.

MrWiseOne: If my assumption is correct, then no, it will show the IP of the network adaptor, and will be of no use to most home users.

Yes, it's the network interface IP address.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Mecctro_
-


Joined: 09 Mar 2006
Posts: 18

PostPosted: Sun May 14, 2006 2:20 am    Post subject: Reply with quote

I need it to display the ip Outside of my network to ppl looking at my server as long as it does that i could care less if it works for me on this computer.
Back to top View user's profile Send private message MSN Messenger
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Sun May 14, 2006 5:22 am    Post subject: Reply with quote

Code:
gethostbyname($_SERVER['HTTP_HOST']); # This work?

_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Networking Issues All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group