Re: [SLUG] Required fields in PHP

From: Dylan William Hardison (dylanwh@tampabay.rr.com)
Date: Wed Feb 18 2004 - 21:35:07 EST


One should do both, as people
can disable javascript or submit the form
without using a browser at all.

Never trust the client! <g>

Spake rwrigh10@tampabay.rr.com on Wednesday, February 18, 2004 at 08:08PM -0500:
> Paul
>
> You should use javascript on the client side to perform the test prior to submission of the form data.
>
> If you must use php then you will have to hit submit and then test the value for each element from the $_POST array like so:
>
> if($_POST["myTextField"]==""){
> //code to show message of failure
>
> }
> else
> {
>
> }
>
>
>
> ----- Original Message -----
> From: Paul M Foster <paulf@quillandmouse.com>
> Date: Wednesday, February 18, 2004 7:29 pm
> Subject: [SLUG] Required fields in PHP
>
> > When coding forms in PHP, is there a _simple_ way to ensure certain
> > required fields are actually filled out?
> >
> > Paul
> >
> >
>
> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS). Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.
>

-- 
If you pick up a starving dog and make him prosperous, he will not bite you.
This is the principal difference between a dog and a man.
              -- Mark Twain, "Pudd'nhead Wilson's Calendar"
-
GPG Fingerprint=D67D 2B75 53C6 9769 30E4  D390 239F C833 F32C F6F6
GPG KeyID=F32CF6F6
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:59:00 EDT