FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Simpler way to validate form fields?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Simpler way to validate form fields? [message #179786] Tue, 04 December 2012 22:37 Go to previous message
Gilles Ganault is currently offline  Gilles Ganault
Messages: 27
Registered: September 2010
Karma:
Junior Member
Hello

If this the best way to validate each and every field in a form, or is
there a better/simpler way?

http://phpmaster.com/form-validation-with-php/
(section "Validating the Form Contents")

Sample:
========
$nameErr = $addrErr = "";
$name = $address "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["name"])) {
$nameErr = "Missing";
}
else {
$name = $_POST["name"];
}
etc.
========

Thank you.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: when receiving the mail(php mail function), the variable's last value is getting converted to $ or # replacing the digit
Next Topic: How to Prevent Apache Server From Hanging while running a batch file?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 14:07:53 GMT 2024

Total time taken to generate the page: 0.05161 seconds