<?php 

$ip = $_SERVER['REMOTE_ADDR']; //Sets the ip variable, its value is a method that will get the user ip
$new = "true";

$file = "ip_list.txt";
$data = file_get_contents($file);





if (strpos($data, $ip)) {
	$new = "false";
}


if (strcmp("true", $new) == 0) {
	$fh = fopen($file, 'a') or die("can't open file");
	$stringData = $ip . "\n";
	fwrite($fh, $stringData);
	fclose($fh);
}

  
echo "ip=" . $ip . "&newUser=" . $new; 
 
?>