Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.5 KB

README.md

File metadata and controls

48 lines (35 loc) · 1.5 KB

Watchers Stars Commits Last Commit GitHub Issues

Simple IP Address Reporting

<?php echo $_SERVER["REMOTE_ADDR"]."\n"; ?>

Pre-requisites

  • Webserver:
    • PHP
    • cURL
  • Client:
    • cURL

Getting started

  • Clone or download the repository into your local directory of choice

  • Upload the file index.php to your webserver

or if you prefer to use your terminal emulator of choice:

$ echo "<?php echo \$_SERVER[\"REMOTE_ADDR\"].\"\\n\"; ?>" >> index.php

  • Open up your console, type curl then replace 'yourserver.com' with the location of your index.php to render the page and display your IP address:
foo@bar:~$ curl yourserver.com
8.8.8.8

Depending on your webserver configuration you may be required to include "/index.php" like:

foo@bar:~$ curl yourserver.com/index.php
8.8.8.8