/    Sign up×
Community /Pin to ProfileBookmark

PHP writing to text file…

Righto!

Does anyone know how I would acheive this? I’m guessing i’ll have to use PHP to do this. I want to be able to write a web form that lets the user input a username and password and then submit the data to another file

what it needs to do is write the username and password to a plain text file called ‘userlist.txt’ on my website.

the ‘userlist.txt’ is not encrypted and displays like this in notepad:-

username1
password1
username2
password2

so when it adds the new user it just sticks the username and password in the next available lines. like this:

username1
password1
username2
password2
username3
password3

any help would be most appreciated,
regards,
Russell

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@SpectreReturnsJan 29.2006 — If you aren't encrypting the passwords AND you're keeping them in a public txt file, I don't think anyone is going to want to sign up. Ever.
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYJan 29.2006 — you could store the password's hash/ or encrypted in some way (md5 for example) but never store the actual password.

you could then put the file in a non-public directory
Copy linkTweet thisAlerts:
@russellkainauthorJan 29.2006 — In reply to:-

If you aren't encrypting the passwords AND you're keeping them in a public txt file, I don't think anyone is going to want to sign up. Ever.[/QUOTE]

I won't be using this on a website, it is for use with a program hosted on a secure intranet and i can ban access to the file by ip control.

regards,

Russell
×

Success!

Help @russellkain spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...