/ Published in: PHP
A simple and dynamic server-side form validation script.
Setup:
1. Insert the field names in the $inputName array and the field descriptions in the respective array pointers in the $inputDesc array.
2. Change the $method to the respective method chosen.
Setup:
1. Insert the field names in the $inputName array and the field descriptions in the respective array pointers in the $inputDesc array.
2. Change the $method to the respective method chosen.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$method = 'GET'; $count = 0; if($_SERVER['REQUEST_METHOD']==$method) { $name = '_'.$method; foreach($inputName as $ele) { else { } $count++; } echo $errorArray[$i]."<br />"; } } }