Re: Validate variables w/out empty
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Wed, 31 Oct 2007 17:05:13 -0500
pgt wrote:
I have a working couple of pages (form submits 2 variables to the second page using GET).
page1 has two dropdowns (generated from MySQL db).
page2 retrieves info from the database accordingly, depending on the passed variables. Works fine.
I need to ensure that the user has actually selected both variables on page1 from each of the drop down options on page1.
empty() seems unable to do this because the default drop down options are "Select one", "Select the other".
so on page2, if the user has NOT made any choices:
echo "Values passed to GET method:<br />\n";
reset ($_GET);
while (list ($key, $val) = each ($_GET)) {
echo "$key => $val<br />\n";
}
gives me:
Select one
Select the other
I can not see how to use empty() or isset() to resolve this, so...
Any ideas how to ensure the user has selected something from both options (without javascript)?
I couldn't find anything in the manual but assume I'm looking in all the wrong places for this.
Thank you.
Some code would help...
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- Validate variables w/out empty
- From: pgt
- Validate variables w/out empty
- Prev by Date: Re: Looking for help on what is probably a simple task
- Next by Date: Re: Session or browser problem??
- Previous by thread: Validate variables w/out empty
- Next by thread: Re: Validate variables w/out empty
- Index(es):
Relevant Pages
|