07-01-2009, 09:21 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
|
Only add if not found...
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 !
PHP Code:
$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!
__________________
That's why we are not alone on earth... let's build !
|
|
|
|