Re: reading variables?

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

 



William Stokes wrote:

> For each printed document there's a check box "Delete" for
> marking that document for deletion. The document info from DB is printed
> using 'while' loop. The only problem I have is that I don't know how to
> handle/read the Delete checkbox values because the checkbox name is
> different for each file. Checkboxes are printed whit this line:"echo "<td
> colspan=\"5\"><input type=\"checkbox\" name=\"del_$id\">Delete</td>";"

Well, it is possible to look at all the fields which match the regular
expression /del_[0-9]+/, but you would probably be better off just doing
something like this:

   <input type='checkbox' name='del[]' value='$id' id='del_$id'>
   <label for='del_$id'>Delete</label></td>

And then accessing the $_POST['del'][] array that PHP will represent that
as.

-- 
David Dorward       <http://blog.dorward.me.uk/>   <http://dorward.me.uk/>
                     Home is where the ~/.bashrc is

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux