26236Using PHP to Interpret Formshttp://www.oreillynet.com/pub/a/392Mosaic, with its multimedia capability, added entertainment value to what had previously been a bland character-based medium. Forms created the capability for dynamic Web sites tailored to user requests. Without either of these two developments, we would all probably be watching TV right now.PHP > Tips and Tutorials > Form ProcessingOct 15, 2006
So you have a form on your website and you want to make sure that your users use the form correctly. So I thought about the best way of doing this, and immediatly dismissed the idea of JavaScript because JavaScript can easily be disabled. So I knew that PHP was the answer. Previous attempts of form validation with PHP led me to create a basic script that would would basically check if any of the fields were empty and output a general message if they were.
A collection of 21 tips on process Web forms with PHP scripts. Clear explanations and tutorial exercises are provided on generating and processing Web forms, getting values out of $_REQUEST, processing multiple choices, removing slashes, adding multiple submit buttons, adding hidden values, processing original query string. Topics included in this collections
The validation of data that has been entered in a form is necessary in most cases. Why is important? For example, what good is holding a contest or sweepstakes if you can't notify the winner, because he or she entered an invalid telephone number or an incorrect address. What good is having a mailing list if the e-mail addresses on it aren't verified, and your mailing list just bounces back to you without reaching the subscribers and target audience.Validating form entries saves you time and more importantly, it can save you money. And since somebody embossed the slogan "Time is money!", this should be very important for your web site!Well when should we validate? There are two types of validation; client side and server side.For reference, client side means that you are depending on what browser the user is currently using. On the client side, validation is performed using JavaScript. And that can be very tricky, because some users turn off JavaScript support in their browsers before they even come to your site. If you encounter of one those users, client side validation won't help you much if you try to verify data from a form because your JavaScript code will not be executed or interpreted by the browser, means you are back to square 1. Remember, the winner of your competition entered a wrong address.This is where server side validation comes in handy. It will always work, no matter what. Of course assuming that you have access to the technology on your server. Server side validation can be done with Perl, PHP, ASP, ColdFusion, JSP and almost any other scripting language. For this tutorial, I'll use PHP. A quite popular and easy to master server side scripting language.
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.