Should work
PHP:<?php $IPs = $_SERVER['REMOTE_ADDR']; //*Open*the*file $fp = fopen("iplog.txt""); //*Write*the*data*to*the*file fwrite($fp, $ips); //*Close*the*file fclose($fp); ?>
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$fopen = fopen("iplog.txt", "w");
fwrite($fopen, $ip);
fclose($fopen);
?>