very simple online registration form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tinoda
Forum Commoner
Posts: 33
Joined: Mon Dec 29, 2008 3:32 am

very simple online registration form

Post by tinoda »

Friends, I have tried my best to use all the php knowledge i have to try create an online registration but I seem not to succeed. I have tried using serialize(), reading and writing to files, session cookies, etc but i cant seem to win. Now the system I need is like this: A user enters ONLY his or her name and after pressing submit the form clears as well as the submit button and their name automatically gets displayed on a table cell which is lets say below or on top of the form. Since this is a small thing I need to do it without using databases. please help
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: very simple online registration form

Post by califdon »

tinoda wrote:Friends, I have tried my best to use all the php knowledge i have to try create an online registration but I seem not to succeed. I have tried using serialize(), reading and writing to files, session cookies, etc but i cant seem to win. Now the system I need is like this: A user enters ONLY his or her name and after pressing submit the form clears as well as the submit button and their name automatically gets displayed on a table cell which is lets say below or on top of the form. Since this is a small thing I need to do it without using databases. please help
There are, conservatively, a hundred ways to do that. It would be better if you told us directly what you are trying to accomplish, not the specifics of how you think you want to implement it. There will most likely be much better ways to achieve your end purpose than the way you described it.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: very simple online registration form

Post by omniuni »

While I agree, there is likely a "better way" I think I can throw together something simple without a DB from code I have. I have written most of a flat-file CMS, so I'm used to working without DB's. If you just want to make their name appear on the page for the duration of them being on the web site, you can use sessions, otherwise, if you'll want them to be able to "log in" again or retrieve their data, a serialized array should do the trick.

Which one is it? I'll try to post some code.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: very simple online registration form

Post by califdon »

You seem to have a grasp on what you're doing, so what is your question? Apparently you only want to display a value that a user inputs on the first page, to appear on subsequent pages during their session, correct? That's what I meant by explaining what you want to achieve. If that's correct, then, as you said, the $_SESSION variable would be the easiest way to go. What have you tried in this regard, that doesn't work?
Post Reply