For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > October 2005 > RE: [PHP-DB] Re: Need help with delete and modify functions on









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] Re: Need help with delete and modify functions on
Linda H

2005-10-18, 6:57 pm


>
>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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com