Re: Re: Variable name as a string

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

 



At 7:08 PM +0100 8/27/08, ioannes wrote:
Yes, Tedd, this does however incur the overhead of find out what i is, because it could be a range of IDs from the database, not necessarily a count of the checkboxes on the page:

"
for ($i = 1; $i <= 4; $i++)
   {
   $a = 'a' . $i;
   $b = 'whatever' . $i;
   if($_POST[$a] == 'on')
      {
       my_array[] = $_POST[$b]
      }
   }
"

John

John:

Yes, and I thought that I showed you how to handle that -- that an easy thing to do.

You simply list all the items you want to expose to the user for the user's consideration to delete. Then you accept what the user has selected and delete them accordingly. (However, you should work out a way to clean this information before doing anything).

I only added the count thing IF you wanted to know how many deletions the user selected.

Please review what I said and consider.

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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