Re: $_POST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thats exactly what i need. Thanks a ton.

~Andrew

On Mon, 17 Jan 2005 10:58:07 +0200, Ville Mattila <ville@xxxxxx> wrote:
> Andrew Maxwell wrote:
> > When you submit something, and you want to make sure that the user
> > inputs all of the info, is there an easier way to do it than this:
> 
> One method I've done that is to create an array with the required field
> names, then loop it through and check whether they all have a value.
> 
> $required = array('name','pass','blah');
> foreach ($required as $req) {
>         if (!$_POST[$req]) {
>                 die("$reg is missing");
>         }
> }
> 
> - Ville
> 
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux