newhck / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

GET Vs POST detection fr form submission #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Love the class but I encountered a problem with the logic the class uses to
determine if the form was submitted by POST or GET in function validate().

 It assumes if $_GET is not empty that the form is being submitted via a
GET rather than a post. This logic causes problems when the form is POSTed
from a page with a url which contains get vars = eg
localhost/index.php?page=page_with the_form_on_it 

Would like to suggest two solutions :
1) Reverse the check order so POST is checked before GET
or
2) Maybe check !empty( $_GET['submit'] ) instead of !empty($_GET)

Original issue reported on code.google.com by iwmacla...@gmail.com on 7 Apr 2010 at 4:37

GoogleCodeExporter commented 8 years ago
Thanks for bringing this bug to our attention.  I have corrected this in a 
development copy by reversing the order 
to first check if the $_POST array is not empty.  This change will be available 
in the next version release.  In the 
mean time, you can either make this change manually in the validate function or 
download the development copy 
from the Source tab.

- Andrew

Original comment by ajporterfield@gmail.com on 7 Apr 2010 at 9:04