As promised, our April discussion will be on form processing. We’ll discuss different techniques available and hopefully find some solutions to the common problems we all face when using forms in our web applications.
For now, the [url=http://www.shazpro.com/presentations/kcpug_forms/form_presentation.swf]meeting notes are hosted here[/url].
A [url=http://www.shazpro.com/presentations/kcpug_forms/multipage_register.php]functional example of a multipage form with source code[/url] is also available.
I also wanted to thank you for the presentation, once again the PUG has furthered my understanding of PHP and programming techniques. In fact I used some of the methods in a project I did today.
Thanks again,
Al
example:
php gets this post as $_POST[‘text_variable’] containing the array $textvariable=array(“test1” => “”,”test2″=>””,”chk1″=””);
Just FYI.
Notice: line 147 – Undefined index: page
line 147 – switch($_REQUEST[‘page’])
Notice: line 129 – Undefined variable: errors
line 129 – if ($errors) // Display Errors if there are any
I corected by changing to
if (‘$errors’)
then the wolowing error showed up:
Debug Warning: line 137 – Variable passed to each() is not an array or object
line 137 – while(list($key,$message) = each($error_text))
I don’t have error reporting set to that high of a level on my systems, which is why I never saw those notices and warnings.
You probably don’t want to do what you did on line 129. $errors is supposed to be a bit value (either 1 for true or 0 for false), so changing it to a string may change the result.
If you don’t want those to show up, you can change your error reporting level, or you can change the code and define those variables at the top of the script. Also, you could put a @ in front to suppress the warning messages.
For instance,
while(list($key,$message) = @each($error_text))
will get rid of your last warning.