26198php form validation tutorialhttp://www.pda-systems.com/content/view/39/9/The HTML markup language has build in codes to provide forms. In forms the user can input fields fill out, in text fields of several lines text enter, from lists of entries selects and so forth.If the form is filled out, the user can click on a Button, in order to process the form. The form contains special tags to indicate what happens with the data of the filled out form. For example send the data by E-Mail or process the data with a CGI program on the server.Generally, the major problem is the form validation.PHP > Tips and Tutorials > Form ProcessingOct 15, 2006Oliver Dornauf
So the Form Mail we're going to make is going to be broken does into 2 parts. One part has the HTML for the form and the second part is the processing for the form. However, we have to work backwards and do the processing before hand. We will ask three things on the form to keep it simple: their name, their e-mail address, and their comments.
1. Use $_SERVER['PHP_SELF'] as a form action.
The $_SERVER auto-global array holds various useful server- and request-specific info. The PHP_SELF element of $_SERVER holds the filename of the currently executing script (relative to your web site's document root directory). So, supplying $_SERVER['PHP_SELF'] as the action attribute of the form tag makes the form submit to the same page that displayed it. This lets you put the logic to handle the form in the same page as the logic that displays it. For many simple forms, this keeps things easy to manage.
Select lists - aka 'drop down box' - are just html. Anybody can code them. Actually, select lists belong somewhere between the open form element, and the close form element. The open form element should have at least a name, method and action properties and optionally an enctype property for file/image uploads. Just like this
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.