insert/update/verify

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
johnworf
Forum Commoner
Posts: 28
Joined: Fri Nov 02, 2007 1:02 pm

insert/update/verify

Post 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
watson516
Forum Contributor
Posts: 198
Joined: Mon Mar 20, 2006 9:19 pm
Location: Hamilton, Ontario

Re: insert/update/verify

Post 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.
johnworf
Forum Commoner
Posts: 28
Joined: Fri Nov 02, 2007 1:02 pm

Re: insert/update/verify

Post by johnworf »

yep that sounds like a good idea - thanks.
johnworf
Forum Commoner
Posts: 28
Joined: Fri Nov 02, 2007 1:02 pm

Re: insert/update/verify

Post 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 ?
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: insert/update/verify

Post by papa »

Don't display the entries that you haven't checked. :)
johnworf
Forum Commoner
Posts: 28
Joined: Fri Nov 02, 2007 1:02 pm

Re: insert/update/verify

Post by johnworf »

so does that mean having 2 columns of data...

verify and checked data fields
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: insert/update/verify

Post by papa »

I think it's enough.
Post Reply