>Start from scratch. You have a file with a single user on each line:
>
>tom\n
>dick\n
>harry\n
>
>You use file() to read into array $users.
>
>You compare as in above.
>
>You add a user by:
>
> $users[] = "NEW_USER\n";
>
>You write out the file as above.
curious... when I ran through that (bef
On Wednesday 17 July 2002 00:44, Dave [Hawk-Systems] wrote:
> > if(in_array($HTTP_SERVER_VARS["REMOTE_USER"] . "\n", $users)) { ... }
> >BTW, it should be:
> >
> > fwrite ($fd, join('', $users));
> >
> >otherwise each time you write the file out it will have an increasing
> > number of "\n" at
>> >> $users[]=$newuser;
>> >> # adds the new user to the end of the above created users array
>> >> # then write the array to the file
>> >> $fd = fopen (".users", "w+");
>> >> fwrite ($fd, join("\n",$users));
>> >> fclose ($fd);
>> >>
>> >> the problem is after adding users, only the last user r
On Tuesday 16 July 2002 22:35, Dave [Hawk-Systems] wrote:
> >> $users[]=$newuser;
> >> # adds the new user to the end of the above created users array
> >> # then write the array to the file
> >> $fd = fopen (".users", "w+");
> >> fwrite ($fd, join("\n",$users));
> >> fclose ($fd);
> >>
> >> the
>On Tuesday 16 July 2002 21:53, Dave [Hawk-Systems] wrote:
>> $users=file('.users');
>> # puts users in the file into an array so we can
>> # check for valid or priv users with
>> if(in_array($HTTP_SERVER_VARS["REMOTE_USER"], $users)){}
>>
>> # we add additional users to the .users file with the f
On Tuesday 16 July 2002 21:53, Dave [Hawk-Systems] wrote:
> $users=file('.users');
> # puts users in the file into an array so we can
> # check for valid or priv users with
> if(in_array($HTTP_SERVER_VARS["REMOTE_USER"], $users)){}
>
> # we add additional users to the .users file with the followin
$users=file('.users');
# puts users in the file into an array so we can
# check for valid or priv users with
if(in_array($HTTP_SERVER_VARS["REMOTE_USER"], $users)){}
# we add additional users to the .users file with the following
$users[]=$newuser;
# adds the new user to the end of the above cre
7 matches
Mail list logo