Get your external IP Address

4 Responses

  1. tito says:

    how i make this to run every 6 hours ?

    i need it on my rapsbery pi

    • Hi! very easy, just define a new cronjob. For this, open /etc/crontab and add a new line:
      0 */6 * * * sh /home/pi/
      remember: 0 and */6 says that this script will be computed every 6 hours at minute 0. You will need to set the path to the script. If you need more information about cronjobs, look at this.

  2. Sajjad says:

    I want to get users real current IP using php how to get this?

    • You can use $_SERVER[‘REMOTE_ADDR’] to get the most relevant IP address from the user… Normally this is his external IP, which should be the same when he has a static IP address or it changes (maybe daily) for dynamic IP addressing. But it can be also anything else, if the user uses VPN or things like TOR network.

Leave a Reply

Your email address will not be published. Required fields are marked *