Re: checkboxes, radio buttons and $_POST['<name>']
| From: | Tim Ward | Date: | Thu, 09 Jan 2003 18:43:02 +0000 |
| Subject: | Re: checkboxes, radio buttons and $_POST['<name>'] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130986@lists.php.net to get a copy of this message | ||
isset($_POST["chk1"]) will only be true if the checkbox is checked.
Tim Ward
http://www.chessish.com
mailto:timward@chessish.com
----- Original Message -----
From: John-Erik Omland <John-Erik@ExploringBalance.com>
To: <php-general@lists.php.net>
Sent: Thursday, January 09, 2003 6:25 PM
Subject: [PHP] checkboxes, radio buttons and $_POST['<name>']
Hi
HELP!!!
I have read through the manual about using $_POST['<name>'] to retrieve
data from forms, but what happens when a form element is not filled in
or checked?
If I have a checkbox on a form called "chk1" I get an error from PHP
when I try this:
$chk1 = $_POST['chk1']; // error if user did not chech the checkbox on
the form!!!
How do ya usefully retrieve the fact that a form element has not been
filled in/checked?
Be Well,
John-Erik Omland
====================================
"Rhythm is the basis of life,
not steady forward progress.
The forces of creation, destruction, and preservation
have a whirling, dynamic interaction."
- Kabbalah