Re: handling of checkboxvalues
| From: | Luis Morales | Date: | Sat, 11 Feb 2006 19:03:04 +0000 |
| Subject: | Re: handling of checkboxvalues | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41226@lists.php.net to get a copy of this message | ||
Well,
you can do this...
form.php
----------------------------------------------------
<?
if($_POST['submit'] == 'send form'){
for($i=0;count($_POST['user_loeschen'])<$i;$i++){
--- put here your sql statement to delete user ---
ej... delete from users where id = '{$_POST['user_loeschen'][$i]}'
---------------------------
}
}
?>
form name='my_form' method='post' action='form.php'
ENCTYPE='multipart/form-data'
<input type='checkbox' name='user_loeschen[] value="<?= $id ?>"
id="<?=
$id?>">
<input type="submit" name="submit" value="send form">
</form>
----------------------------------------------------
On Sat, 2006-02-11 at 17:48 +0100, Ruprecht Helms wrote:
> Hi,
>
> I want to have a function that delete some customers. The customers will
> be selected by cklicking on in checkboxes. This is the line I codes the
> checkboxes:
>
> <input type='checkbox' name='user_loeschen[] value="id"
> id=".[User-ID].">
>
> How can I use the checkboxvariable within another script and handle the
> id-value? I little codescripplet will help me.
>
> Regards,
> Ruprecht
>
--
---------------------------------------------------------------------------------
Luis Morales
Consultor de Tecnologia
Cel: +(58)416-4242091
---------------------------------------------------------------------------------
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
---------------------------------------------------------------------------------