You are here: Re: Having trouble with php....input type=hidden « All PHP « IT news, forums, messages
Re: Having trouble with php....input type=hidden

Posted by dba on 10/17/07 02:00

Thank you. I will give that a try.


Jerry Stuckle wrote:
> dba wrote:
>
>> Without giving a lot of script at this time, I am having a problem
>> with php and form input type="hidden". Problem is that the hidden
>> variable displays last line from database query.
>>
>> Some code.
>> if ($field_name=="member_lname") {
>> echo "<input type='radio' name='selection' value=' " .
>> $result['member_lname']. ',' .$result['member_fname'] ." ' > " .
>> $result['member_lname'] . ', ' . $result['member_fname'] . "<br />";
>> echo "<input type='hidden' name='member_id' value=" .
>> $result['member_id'] . " ' >" . $result['member_id'] . " />" ; }
>>
>> produces this from form:
>> Back, Joe 0026
>> Clan, Bill 0025
>> Dant, Norbert 0020
>> Cleene, Nor 0013
>> De Wa, Frank 0012
>> Erick, B.C. 0006
>> Evans, Mary 0027
>> Far, Steve 0005
>>
>> after selection from form $_POST produces
>> correct name "Dant, Norbert" but grabs last number "0005" and not "0020".
>>
>> Any help would be appreciated.
>>
>
> To get multiple values returned, you need to use an array, i.e.
>
> echo '<input type=hidden name="member_id[]" value="' .
> $result['member_id'] . '">';
>

 

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

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