Chris Lott wrote:
What I have is a form with 45 data fields... if any of a selected 35
of those fields is empty, I want to have the user go back. So I can't
loop over the entire _POST array. So I thought I would put the names
of the fields I *do* want to check into an array and check.
So this wo
What I have is a form with 45 data fields... if any of a selected 35
of those fields is empty, I want to have the user go back. So I can't
loop over the entire _POST array. So I thought I would put the names
of the fields I *do* want to check into an array and check.
So this won't work:
> foreach(
Jim Moseby wrote:
I want to do something like this to check if a variety of submitted
form fields (crn, instructor, etc) have any value in them:
$reqfields = array('crn', 'instructor');
$errorflag = 0;
foreach ($reqfields as $field) {
if ($_REQUEST[$field] == '') {
$erro
You could use the isset() or the empty() functions.
http://us3.php.net/manual/en/function.empty.php
http://us3.php.net/manual/en/function.isset.php
But do you want to check all the fields that are being submitted or just
specific ones that you set in the $reqfields array? If you want to check a
>
> I want to do something like this to check if a variety of submitted
> form fields (crn, instructor, etc) have any value in them:
>
> $reqfields = array('crn', 'instructor');
> $errorflag = 0;
>
> foreach ($reqfields as $field) {
> if ($_REQUEST[$field] == '') {
> $errorfl
5 matches
Mail list logo