Asp - Wan Ip

Admiral Michael

OSNN Veteran Addict
Joined
19 Feb 2003
Messages
3,123
Hey all,

I basically got this system script done the way I want (http://www.michaelsoft.gotdns.com/stats.asp) cept for the Server IP. Since the computer is behind a router it shows my LAN IP, which is the result of using Request.ServerVariables("LOCAL_ADDR").

Any Ideas how to grab the IP (in ASP, dont want to mix languages. It all I kno besides HTML and a little javascript) from a site like http://checkip.dyndns.org or if you have another idea how to get the IP.

Mike
 
That would most probably end up displaying the internal IP of the router
(...based on my very limited knowledge of ASP :))
 
lad_in_brum said:
Try REMOTE_ADDR
Isn't that the client's IP?

In PHP I'd use $_SERVER['SERVER_NAME'], which displayes the name or IP used to reach the server (changes between LAN and WAN users). But I'm not sure what the corresponding variable in ASP is...

You could of course parse http://checkip.dyndns.org/ using ASP and get the IP that way, but it's very slow since you have to do this every time you get a page access.
 
Thanks all, It seems it's more difficult then I thought. I think I will just have it show the LAN ip then.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back