Make your own free website on

Visit the Official PHP Website

Search this Site

PHP Programming

By James N Hitz


Lesson 6 was short! Short and thorough. If you have come straight from Lesson 6 then you might have wondered how I got to merge Lessons like that. I feel Lesson 6 and 7 complement each other and that is the reason for the Mighty Skiiiiiiip.

In Lesson 6 we talked about what happens when a user enters form data to be be used by a PHP script. In the lesson we outlined some of the considerations that you will have to put in mind when preparing your HTML forms to be used with PHP.

Just as to jog ya' brains, you will remember we said that:

  1. all your HTML form widgets must have a name attribute
  2. all your form widgets representing the same subject SHOULD have the same name
  3. some widgets, eg. hidden controls, check boxes, radio buttons, command butons (submit, reset, button) MUST have a value attribute for them to be PHP-friendly
  4. a form must have an action property specifying the PHP script to be executed on submission. Of course every form must have one <SUBMIT> button
  5. always set a METHOD for the form to either PUT or POST - PUT for small forms, POST for large forms (I said I'll use POST all through my examples
  6. in your PHP scripts, DONT TRUST THE USER TO DO THE RIGHT THING. Always validate your scripts.
  7. when validating, you can use relational operators but they only provide you with MINIMAL power. Use regular expressions instead.

The last point is what I did not make clear. What are regular expressions?

<< Back to beginning of Lesson 6 | Regular Expressions >>

JamHitz Productions