You are here: Re: [PHP] build an array of checkbox « PHP « IT news, forums, messages
Re: [PHP] build an array of checkbox

Posted by Leif Gregory on 03/18/05 20:09

Hello Tomás,

Friday, March 18, 2005, 1:31:40 PM, you wrote:
T> I have a doubt, I want to build an array of checkbox, why? well
T> because I list a recordset from data base, and I want to delete the
T> current record when the check is selected by the click mouse. for
T> example the editor of mail.yahoo.xx, that you can delete any mail
T> when you selected any checkbox.

<input type="checkbox" name="delete[]" value="<?php echo $r['id']; ?>" />


delete becomes your array
i.e. print_r($_POST['delete']);

$r['id'] is the record id from the DB.

Then do a foreach through the delete array and delete out records
where id = the "as" variable used in the foreach.


--
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.0.9.7 Return (pre-beta) under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация