Jump to content

Form validation?


eduard

Recommended Posts

validation means checking the inputs against your criteria..which you have set for your form..so there is no particualr way to describe validation i think...you may more specific.there is pined topic in the php forum of tips for php..where you can find how to throw error if any inapropiate value comes ..then check that if any errors are there or not..if no errors are there you process the form.

Link to comment
Share on other sites

The data from the form becomes input for PHP... which PHP file? Whichever you point to in the HTML form. One of the many things PHP can do with this input is check if it is valid according to certain criterias you program.That's all there is to it. Everything else is a consequence from the above.

Link to comment
Share on other sites

But why do you have to do this before the form is sent to the user´s browser
? though not sure what you meant exactly..you cant trust any inputs which are coming from outside..suppose you have a field for age if you wont validate it. any one can send chacracters or even some inetger which sould not suoopsed to be an age. so you would like to stop processing of the form when any inapropiate value comes.its the common example in some case not doing validation (or not doing it apropiately) can create some securitiy troublevalidation is very importnant part..i think
Link to comment
Share on other sites

often times forms are validated on the client side as well (javascript) to provide instantaneous feedback before the form is even submitted. However, there is much to do aside from checking for letter, numbers, etc as PHP process a form. There are security measures to take into account, especially if the data is going into a database.

Link to comment
Share on other sites

often times forms are validated on the client side as well (javascript) to provide instantaneous feedback before the form is even submitted. However, there is much to do aside from checking for letter, numbers, etc as PHP process a form. There are security measures to take into account, especially if the data is going into a database.
Is it a kind of ´Filter or Firewall´ for the programmer?
Link to comment
Share on other sites

yes, pretty much. As mentioned previously, you should always do as much as you can to make sure user submitted inputs, or data passed via $_GET is thoroughly validated and checked to make sure it doesn't contain anything harmful.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...