Jump to content

PHP IP address


woody79

Recommended Posts

In my world the WAN IP and external IP (the IP address computers outside his LAN sees) is one and the same thing - so $_SERVER['REMOTE_ADDR'] is how you get the WAN IP.

 

If you mean the LAN IP, like 10.0.0.1, 10.0.0.17, 192.168.0.4 ect. there is no way of getting it with PHP. The reason why I suggest / think you mean LAN IP is because it would be very handy, e.g. for polls where you don't wanna use cookies but want to let everyone on the same LAN vote :)

Link to comment
Share on other sites

you can use php to get anythink u want all you do is use the exec() function to pass relevent query to msdos

then write the info to a text file or database and show info.

 

hackers do it all day but if the relevent server has setup example apache properly you want get all information ok.

Link to comment
Share on other sites

I don't think you can get a users LAN ip-address if he just visits your site... I don't think woody79 want the servers LAN ip...

When the computer is inside the workplace and it is set to bypass proxy for local servers, $_SERVER['REMOTE_ADDR'] gives me their LAN IP. When they access the page from outside the workplace, it gives me DNS. I have no idea why!

Link to comment
Share on other sites

 

If you mean the LAN IP, like 10.0.0.1, 10.0.0.17, 192.168.0.4 ect. there is no way of getting it with PHP. The reason why I suggest / think you mean LAN IP is because it would be very handy, e.g. for polls where you don't wanna use cookies but want to let everyone on the same LAN vote :)

youre not supposed to be able to get this.  it's a security feature of routers and such.  i mean, thats why they do it.

 

if you want to allow ppl on the same LAN to vote, try using cookies and IP logs.  i know its not flawless cause as soon as the cookie expires they can vote again, but thats all i can think of atm heh.

 

umm, this may seem like a stupid question, but where is the server?

What do you mean exactly?

if the server is on the LAN, then when it retrieves the user's IP, it will be the LAN address (ie 192.168.1.xxx, etc.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.