RE: [PHP-DB] Re: Need help with delete and modify functions on a form.

From: Date: Tue, 18 Oct 2005 19:39:04 +0000
Subject: RE: [PHP-DB] Re: Need help with delete and modify functions on a form.
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-40526@lists.php.net to get a copy of this message
<?php echo $_POST["check"][2]; ?> 2) the name/value pair will only be POSTed if it's checked, so that would only work if the first two were checked. Some people like to pair all their checkboxes with a hidden of the same name, the hiddens value will be sent if the checkbox isn't checked.
The following method worked well for me using the ternary conditional operator (?:): $step = (isset($_POST['step'])) ? $_POST['step'] : NULL; isset checks to see if a field named 'step' was received thru a POST operation. The statement creates a variable named $step. If the field 'step' was passed, it sets $step to it's value. If the field 'step' was not passed, it sets $step to NULL (you could set it to anything you wanted). Be sure you keep it straight whether the field you are looking for was passed by a POST or a GET. If the field is appended on the URL, use $_GET['fieldname']. It is possible to receive formfields through a POST operation and fields on the URL (use GET) at the same time. LInda Hobbet

« previous php.db (#40526) next »