Re: Reading registry values
| From: | Richard Lynch | Date: | Wed, 08 Aug 2007 04:14:53 +0000 |
| Subject: | Re: Reading registry values | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260412@lists.php.net to get a copy of this message | ||
On Tue, July 31, 2007 4:54 pm, \"Crash\" Dummy wrote:
> To answer everyone's curiosity as to why I want to access the
> registry, I am
> working on my home computer with a dynamic IP, and I need to know what
> it is so
> I can modify my httpd.conf (or hosts) file, if necessary.
LOL
Take a look at whats in $_SERVER:
<?php var_dump($_SERVER);?>
Your IP address is almost for sure in $_SERVER['HOST_ADDR']
That is filled in by the web-server, and should reflect your actual
current IP address.
If you have a NAT-ing router in between, then, no, it won't be your
"public" IP... At that point, I'd almost suggest bypassing the
Registry and COM flakiness and see if something like this works:
http://l-i-e.com/ip.htm
http://l-i-e.com/ip.phps
ymmv, but I'd much rather trust an external server than some goofy
Windows registry setting... :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?