Form Validation Using PHP

Very first we have to create a form in html setting action “#” and method “POST” with some fields, when a user clicks on submit button all the data starts travel in URL but it will be hidden, as we set method = “POST”.

Now, on page refresh, PHP code runs, all values fetches from URL into PHP variables and aplying preg_match ( )  function on them.