View Single Post
  #1 (permalink)  
Old 07-01-09, 05:21 PM
peuplarchie's Avatar
peuplarchie peuplarchie is offline
Newbie Coder
 
Join Date: Nov 2008
Posts: 64
Thanks: 1
Thanked 0 Times in 0 Posts
Post 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!
Reply With Quote