Page 1 of 1

insert/update/verify

Posted: Thu Feb 19, 2009 8:17 am
by johnworf
What is the best way for people to enter data into a table?
where i can verify that the info doesn't contain rubbish entries or vulgar comments etc.

i was thinking of passing a hidden variable and then updating this to a different value (so basically true or false) when i'm happy with the content - or just delete it if it's rubbish...

..ideally this would be a checkbox updated form so rather than having to submit each one and saying yes that's good i could just checkbox 20 hit submit and they would all then be available for show in the database.

Is this the right way of going about it and as i'm pretty much a newbie any ideas would be useful of any existing code that already does this sort of thing that i can integrate into my dreamweaver created masterpiece 8O

Re: insert/update/verify

Posted: Thu Feb 19, 2009 12:32 pm
by watson516
This is a pretty simple thing to do.

Add a column in the table something like comments_verified that will be either 1 or 0(default 0). If 0, you need to verify before displaying them so on the verify page, query all of the entries that have comments_verified = 0 and on the display page comments_verified = 1.

When you list all of the comments to be checked, put a checkbox beside each one with a value of the comment's id. When you click the submit button change the value of comments_verified to 1 for each checkbox that is checked.

Re: insert/update/verify

Posted: Thu Feb 19, 2009 7:30 pm
by johnworf
yep that sounds like a good idea - thanks.

Re: insert/update/verify

Posted: Mon Feb 23, 2009 7:40 am
by johnworf
watson516 wrote:This is a pretty simple thing to do.

Add a column in the table something like comments_verified that will be either 1 or 0(default 0). If 0, you need to verify before displaying them so on the verify page, query all of the entries that have comments_verified = 0 and on the display page comments_verified = 1.

When you list all of the comments to be checked, put a checkbox beside each one with a value of the comment's id. When you click the submit button change the value of comments_verified to 1 for each checkbox that is checked.
I'm just thinking wouldn't i need 3 values...

0=don't display, 1=need to check, 2=show the data ?

Re: insert/update/verify

Posted: Mon Feb 23, 2009 8:01 am
by papa
Don't display the entries that you haven't checked. :)

Re: insert/update/verify

Posted: Tue Feb 24, 2009 9:02 am
by johnworf
so does that mean having 2 columns of data...

verify and checked data fields

Re: insert/update/verify

Posted: Tue Feb 24, 2009 9:14 am
by papa
I think it's enough.