eduard Posted February 8, 2011 Share Posted February 8, 2011 Can someone explain to me how form validation works?especially: to post the form to it self and what about the browser? Link to comment Share on other sites More sharing options...
aradmoradi Posted February 8, 2011 Share Posted February 8, 2011 Can someone explain to me how form validation works?especially: to post the form to it self and what about the browser?hi .can you explain more?i couldn't understand! Link to comment Share on other sites More sharing options...
birbal Posted February 8, 2011 Share Posted February 8, 2011 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 More sharing options...
boen_robot Posted February 8, 2011 Share Posted February 8, 2011 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 More sharing options...
eduard Posted February 8, 2011 Author Share Posted February 8, 2011 But why do you have to do this before the form is sent to the user´s browser? Link to comment Share on other sites More sharing options...
birbal Posted February 8, 2011 Share Posted February 8, 2011 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 More sharing options...
justsomeguy Posted February 8, 2011 Share Posted February 8, 2011 In this thread there are some examples of forms submitting to themselves and validating. The form data only gets validated if the form was submitted, there's no validation when they first load the page.http://w3schools.invisionzone.com/index.php?showtopic=12509 Link to comment Share on other sites More sharing options...
thescientist Posted February 8, 2011 Share Posted February 8, 2011 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 More sharing options...
eduard Posted February 8, 2011 Author Share Posted February 8, 2011 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 More sharing options...
thescientist Posted February 8, 2011 Share Posted February 8, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.