• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Need server IP script

heymrdj

The Debian Lover
NLC
I need a script that shows the servers IP address to a page. This way from a remote location i can find my home server's ip address (it's dynamic, it's updated by DYNDNS, but i need to see the IP myself for Ventrillo logs). So just a simple script that shows the current public IP of the server.



Thanks alot. :)
 
PHP:
<?php
echo gethostbyname($_SERVER['HTTP_HOST']);
?>

Should return the address associated with the DYNDNS record ... I said should ... if HTTP_HOST is localhost, then replace that with the hostname like

PHP:
<?php
echo gethostbyname("freewebspace.net");
?>
 
Thx

Thx Joe, works well on my local xampp server, I'll try it when i get home on my Debian home server when I get home, but it looks like it works. Thx alot :D
 
Back
Top