PHP Classes

How do we save data?

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  How do we save data?  >  (Un) Subscribe thread alerts  
Subject:How do we save data?
Summary:I would like to store it in a MySQL database
Messages:4
Author:Mat Patnik
Date:2009-01-28 23:37:54
Update:2009-01-29 04:59:46
 

  1. How do we save data?   Reply   Report abuse  
Picture of Mat Patnik Mat Patnik - 2009-01-28 23:37:55
I have listen the videos, search through the documentation but can not find where to store my data into a database.

Do I have to wait until the page is done to get the information or can I catch the info in between the validation and the printing of the page?

  2. Re: How do we save data?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-01-29 01:32:07 - In reply to message 1 from Mat Patnik
The forms class itself does not process the forms. You need to insert the code that does your form processing right after the condition that determines if the submittted form is valid.

  3. Re: How do we save data?   Reply   Report abuse  
Picture of Mat Patnik Mat Patnik - 2009-01-29 04:13:52 - In reply to message 2 from Manuel Lemos
Can you give me a hint on where to catch data before the output please.

I am trying to understand your class but I am having a hard time.

  4. Re: How do we save data?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-01-29 04:59:46 - In reply to message 3 from Mat Patnik
I just explained it.

If you read the comments of the test_form.php example script, it says in the condition that tests if the form is valid.

/*
* It's valid, set the $doit flag variable to 1 to tell the form is ready to
* processed.
*/

$doit=1;


Then below you can read this:

if($doit)
{

/*
* The form is ready to be processed, just output it again as read only to
* display the submitted values. A real form processing script usually may
* do something else like storing the form values in a database.
*/
$form->ReadOnly=1;
}