RE: Self-Process php forms or not?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks a lot. To all. 
For the moment, I'm with the redirect solution that others have pointed. 

But after seen tedd example and watch Manuel videos, I'm starting to
understand how the hidden field solution work as well. Well... I'm
*starting* to understand I've not fully understand it yet, despite all your
great examples. 

Because the structure of the code with hidden fields, seems quite different
from the structure I have right now and I'm unable to make the switch. 

Here is the actual structure:

if (isset($_POST['submit']))
{
	
  //declare variables
  $var = $_POST['var']; etc...

  //validate

  //process the form 
  (send e-mail or save to database etc...)

  //redirect to success page.
} 
else 
{
Echo "Sorry, couldn't process the form";
}

<html form>

I suppose that the echo message telling "we couldn't process the form" does
not appear when the form first loads, because the server side script is not
requested on load, it is requested when the form submits to the php code
presented on that same page (self). Tom Worster, is this precise?


In the future, I will print tedd example, and Manuel scheme, and try to
change the code above to accommodate hidden fields, because I still prefer
having only one file.


Thank you all once again,
Márcio








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux