Re: Form Loop

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

 



>
>>
>> the name value quantity needs the value of x appended to it. quantity_1,
>> quantity_2 etc.
>>
> I recommend using array notation instead of appending $x to the element
> name. If you are using POST, when the form is submitted the values are
> available in the $_POST['quantity'] array. You can use foreach to iterate
> through it.
>
> Example:
> <?php
> $values = $_POST['quantity'];
> foreach ($values as $value) {
>   echo $value;
> }
> ?>
>
>
> Regards,
>
> --
>
> With warm regards,
> Sudheer. S
> Business: http://binaryvibes.co.in, Community: http://lampcomputing.com,
> Personal: http://sudheer.net


Arrays are definitely the way to go, not only is it easier to process,
adding new rows on the form can be done with simple javascript then if
needed
-- 

Bastien

Cat, the other other white meat

[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