Re: handling of checkboxvalues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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"
---------------------------------------------------------------------------------

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux