yes/no to confirm adding record to database
Moderator: General Moderators
-
Rogerconant
- Forum Newbie
- Posts: 5
- Joined: Mon Dec 01, 2008 11:44 am
yes/no to confirm adding record to database
I have an html form which collects info, then a php process which gets the info and sets it up for entry into a database, showing the record which will go in. I want a "add this record to the database? yes/no" query before the record is put into the database, but without javascript. How can I put a form (or something) in this php file which gets the yes/no answer and then continues in the same php script from that point?
Re: yes/no to confirm adding record to database
Rogerconant wrote:I have an html form which collects info, then a php process which gets the info and sets it up for entry into a database, showing the record which will go in. I want a "add this record to the database? yes/no" query before the record is put into the database, but without javascript. How can I put a form (or something) in this php file which gets the yes/no answer and then continues in the same php script from that point?
Maybe a popup form ? I would highly suggest using javascript.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: yes/no to confirm adding record to database
Are you talking about confirming the posted form? If so, save the posted data and set a flag for confirm and confirmed. Confirm true means that you need to confirm. Confirm false means the confirm was given so check confirmed. Confirmed true means go ahead, confirmed false means don't go ahead.
Basically you are looking at a two step form unless you add the check box piece to the original form. I would also suggest javascript to handle confirmations, but only add that in after the PHP code does it for handling cases of users who turn off javascript (like I do all day long just to see who is really aware of how their users mess with their sites
).
Basically you are looking at a two step form unless you add the check box piece to the original form. I would also suggest javascript to handle confirmations, but only add that in after the PHP code does it for handling cases of users who turn off javascript (like I do all day long just to see who is really aware of how their users mess with their sites