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 10/12/38 11:59

And this is how I have worked around this problem. Admittedly this is
not a very elegant solution, but I present it for the benefit of those
who like me fail to find a better solution and will trawl the archives
in search of this very workaround in the future. :-)

In the main form I have,

<input name='"choice0'"type="checkbox" value='"first value">
<input name='"choice1" type="checkbox" value='"second value">
<input name='"choice2" type="checkbox" value='"third value">


etc.
plus a hidden input field
<input name="displayedchoices" type="hidden" value='"3"> //equal to the
number displayed.

In the processing script

$choicesDisplayed = $_REQUEST['displayedchoices'];
for($i=0; $i< $choicesDisplayed; $i++)
{
$read = 'choice'.$i;
$setvalue = $_REQUEST[$read];
echo "Value of $read is ".$setvalue;
echo "<br>\n";
}


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

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