You are here: Re: Retrieving the multiple values set by a form « PHP Programming Language « IT news, forums, messages
Re: Retrieving the multiple values set by a form

Posted by Girish on 11/15/12 11:59

Jerry Stuckle wrote:
>
> Girish,
>
> First of all, it should be $myArray[0], not $myArray['0']. It has a
> numeric index. And the fact count($myArray) has the correct value
> indicates the values are correct.
>

Hi Jerry, I had tried both $myArray[0], not $myArray['0'], behaviour
was the same in both cases.
"
> Also, the way you have it coded, if the 'second value' checkbox is not
> checked, myValue[1] will not be set and you'll get a notice if you try
> to use it. Unless you absolutely have to have the indexes like that, a
> better way is to use:
>
> <input name='inp[]' type='checkbox' value='first value'>
> <input name='inp[]' type='checkbox' value='second value'>
> <input name='inp[]' type='checkbox' value='third value'>
>
> Now inp[0] will contain the value from the first checked box, imp[1]
> will contain the value from the second checked box, etc.
>

Ah. gracias. This probably would have worked. The reason I was using
POST was just that GET is easier to debug AND to save as a link to the
report page.

thanks everyone!
Girish

 

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

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