Editing a txt file online?

liunx

Guest
Don't know where this one should go, so I'll let a mod decide...<br />
<br />
I have URL security on my website, and the usernames and passwords are stored in a text file on the server.<br />
<br />
The format in the text file is username=password i.e.<br />
<br />
mike=dingbat<br />
<br />
Is there a way of getting a user to register a name and password and then writing these automatically, or do I have to email it to me and manually edit?<br />
<br />
Confused Mike<!--content-->you can have the page write to a file but it can only be done in cgi/perl, php, asp. which one can you use?<!--content-->Hi micosol,<br />
<br />
Very possible with any server side script. But you will need the script to also check that the username does not already exist before allowing a new member to signup automatically. <br />
<br />
Kevin<!--content-->Scoutt,<br />
<br />
I am hosting on Windows 2000 server, can use cgi, asp and I think php.<br />
<br />
Kevin, how?<!--content-->Sorry, I don't know PHP or ASP scripting, I'm strictly a PERL guy myself. It is still possible, and still necessary to check for duplicate usernames no matter what server side script you decide to use.<br />
<br />
Kevin<!--content-->I can use perl, I do have a directory for the perl libraries, any help?<!--content-->something like this<br />
<br />
$new_user .= "$as{'$user_name'}|"; #0<br />
$new_user .= "$as{'password'}|"; #1<br />
<br />
chmod(0777, "$cgi_path/users/user_data.pl");<br />
open (USER_DATA, ">>$cgi_path/users/user_data.pl");<br />
@user_array = <USER_DATA>;<br />
unshift(@user_array, "$new_user");<br />
print USER_DATA @user_array;<br />
close (USER_DATA);<br />
<br />
&exclusive_unlock(LOCK);<br />
<br />
exit;<br />
<br />
}<br />
<br />
this will save it as <br />
mike|dingbat<!--content-->Thanks, but it HAS to be in the form<br />
<br />
mike=dingbat<br />
fred=barney<br />
<br />
and it has to be in a .txt file<br />
<br />
= is required<br />
<br />
This is a constraint set to me by my host server, if I wanted to go to a database my cost for the password-protected area will be timesed by 10!!!!<!--content-->so change the extension to txt and it should work. what difference does it make if you have the | or = if it is in a txt file? each one will be on it's own line.<!--content-->Apparantly the sever systems look for the = as a seperator, this is out of my control. I will try it, but just in case it doesn't work, is there a way of putting an = sign in instead?<!--content-->is the script providied by your server provider?<!--content-->if you seperate the username and password with an equal sign then you probably can't allow the use of the equal sign in usernames or passwords or else you will get a file like this:<br />
<br />
kev=in=reddog<br />
<br />
in which case "kev" will be the username and "in" will be the password.<br />
<br />
Regards,<br />
Kevin<!--content-->
 
Back
Top