Good day to you all,
My code is looking for user name in a file, if match found, do nothing, if no match found, add to list.
Right now, it add anyway !
$activeadmlist = "user_list.txt";
$pos = strpos($activeadmlist, $_SESSION['username']);
if ($pos === false) {
$output= $_SESSION['username']."\n";
$newfile="user_list.txt";
$file = fopen ($newfile, "a");
fwrite($file, $output);
fclose ($file);
} else {
}
Thanks!