Re: Re: Re: How do I convert from perl to php?
| From: | Joshua Hoover | Date: | Tue, 20 Nov 2001 22:38:11 +0000 |
| Subject: | Re: Re: Re: How do I convert from perl to php? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75313@lists.php.net to get a copy of this message | ||
BUT, that code doesn't take into account that you may have other form parameters that you DON'T want to require. With that code below, you're requiring EVERY form element to be filled out. That's not what the original post requested. He asked for a way to require specific fields according to the way his Perl code reads.
Joshua Hoover
Now this looks like what I would want... brandon ----- Original Message ----- From: "Philip Hallstrom" <philip@adhesivemedia.com> To: <digital1@olypen.com> Cc: <php-general@lists.php.net> Sent: Tuesday, November 20, 2001 2:22 PM Subject: [PHP] Re: Re: How do I convert from perl to php? You could do something like this... there are lots of ways to validate your data... while( list($key, $value) = each($HTTP_POST_VARS) ) { if( empty($value) ) { print("Sorry, you left $key empty."); } } This is assuming the form method is POST. If it's GET, switch POST with GET above. -philip