Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2001071

[PHP-DB] Re: Stupid question From: Johannes Janson (johannes.janson <email protected>)
Date: 07/09/01

Hi,

>1. I have checkbox NAME="x" on Page1.
>2. On page two I want to check ($x) if it's checked or not. How can I do
it.
>3. What value is stored in $x.

PHP makes a variable out of every form element. You don't need to do a
thing.
So assuming this is within <form> and </form> tags:
<input type="checkbox" name="x"> you can check on the action page of the
form if "x" is checked by isset(). So if(isset($x)) { ... } would be
checking it.
If you don't give the checkbox a value it will be "on" if checked and
nothing
or "0" if not checked.
You can always check the submitted values by this little script:

while (list($key, $value) = each($HTTP_POST_VARS)) {
            echo "$key: $value<br>";
}

hope it helps
Johannes

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>