Monday, November 24, 2014

IP store in a File

keep IP  from visitors and place them on a file.


<?php
$file = fopen("ip.txt","a");
$ip=$_SERVER['REMOTE_ADDR'];
echo fwrite($file,$ip);
fclose($file);
?> 
this store in a file as name ip.txt
("ip.txt","a"); 
the second parameter can use "w" if you want only write mode 
"a" stands for append mode .

No comments:

Post a Comment

How to Host a Laravel Project on Hostinger’s hPanel: A Step-by-Step Guide

How to Host a Laravel Project on Hostinger’s hPanel: A Step-by-Step Guide If you're looking to host a Laravel project on Hostinger’s hPa...