[PHP] Dynamic Array Index using Variable

2006-01-09 Thread Chris Lott
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] == '') { $errorflag = 1;

RE: [PHP] Dynamic Array Index using Variable

2006-01-09 Thread Jim Moseby
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] == '') { $errorflag = 1;

RE: [PHP] Dynamic Array Index using Variable

2006-01-09 Thread Jay Paulson \(CE CEN\)
all the submitted fields just run through the $_POST or $_GET arrays, depending on your form method. jay -Original Message- From: Chris Lott [mailto:[EMAIL PROTECTED] Sent: Mon 1/9/2006 2:31 PM To: PHP General Mailing List Subject: [PHP] Dynamic Array Index using Variable I want to do

Re: [PHP] Dynamic Array Index using Variable

2006-01-09 Thread Al
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] == '') {

Re: [PHP] Dynamic Array Index using Variable

2006-01-09 Thread Chris Lott
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: