Posted by Hilarion on 09/13/05 13:15
> I would transfer the result of a checkbox selection into an SQL request.
<form action="save_checkbox.php" method="post">
<input type="checkbox" name="ck" /><br />
<input type="submit" />
</form>
<?php
// save_checkbox.php
if (!empty($_REQUEST['ck']))
$ck = 'a';
else
$ck = 'b';
$qry = 'SELECT some_column '
. 'FROM some_table '
. 'WHERE ck = \'' . $ck . '\' '
. 'ORDER BY some_column'
;
perform_query( $qry );
?>
Hilarion
[Back to original message]
|