I would like display visitor ip address and location on my website and save it in ip.txt file in my webserver.
How can I do it?
<?php $ip=$_SERVER['REMOTE_ADDR']; $file = fopen('ip.txt','w'); fwrite($file,$ip); echo "Your IP Address is $ip"; ?> //When I run in my xampp localhost I got like this?why? // Your IP Address is ::1
I appreciate your answer