And the PHP manual fails me! I am searching for something that explains all of the possible switches for using preg_match and other functions for performing web form validation. The PHP manual shows precious few examples and the user contributed notes show some things but do not explain them. I have a pile of PHP books sitting next to me and none go into detail. Is there a resource somewhere which goes into detail? I have Googled all day and found a snippet here, a snippet there, none of which are coded the same, other resources for using Java and ASP and .NET, but nothing that really explains how to completely validate a form. Does anyone know of a resource?

    I don't think you'll find a one-size-fits-all script. I've looked. 🙂

    The reality is that all forms need to be validated in different ways. You'll find that there will be times where you don't allow any HTML from a text area, and other times where you'll let some tags through. It varies. I'd recommend building some scripts that you can carry from project to project and alter easily to suit your needs.

    Then again, maybe I haven't looked hard enough for the Holy Grail of form validation.

      I wish there were a Holy Grail, but I am pretty sure there isn't.. I am so noobish though I am not exactly sure the format to type. I see things begin like

      (!preg_match("/[0-9.-\ß\ä\Ä\ü\Ü\ö\Ö\ ]+$/s"

      but what the heck does half (or all!) of that mean? Is there something that explains why I would use a carat first and how to use combinations of backslashes and numbers/letters to attain the desired outcome?

        Regular Expressions are definitely not easy to decipher at first glance. 🙂

        I found that JavaScript: The Definitive Guide does a good job explaining them. Your milage may vary.

          There we go! It's a nice start and will show me plenty more than I may have luckily guessed so far!

          Thank you kindly!

            Write a Reply...