Hi..
I am a beginner..
Could someone please help me out for loging form handling without using database.. I mean I wanna save data from user registration form to a text file(e.g username, password etc).. After that, I wanna use that text file for login validation..
What Im trying to do is saving data from registration form into an php array and write em back to a text file.. And then, I will retrieve the information from the array to validate the login information ( username and password).. But I am facing the problem of saving data into array..
I know its for my lack of programming knowledge. Could someone please help me?
login form handling using text files
Moderator: General Moderators
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: login form handling using text files
Why don't you want to use a database?
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: login form handling using text files
Okay. Well, you have a few options. You can serialize() the array and write it to the file, or you can use XML. For just a school project, using serialize() would be easier. Just put everything you get from the signup page in the $_POST or $_GET variables into a hash, serialize() it, and then write it to a new line in the file with fopen() and fwrite(). All functions here are links to the manual.Lamintun wrote:Hi, Jonah..
Actually Im working on for my assignment in my college.. I can only use text files for doing this.. Could you please help me with this?
Thank you for your reply.
Rgds,
Lamin.