FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to get the POST name of a field in a form that uses a counter
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How to get the POST name of a field in a form that uses a counter [message #185937 is a reply to message #185935] Thu, 15 May 2014 02:29 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 15/05/14 02:19, Denis McMahon wrote:
> On Wed, 14 May 2014 23:22:37 +0000, Adrienne Boswell wrote:
>
>> I need to how to get the POST name of a field in a form that uses a
>> counter.
>
> You might also want to look at the following example:
>
> <?php
> $h=array(20,30,5,10,15);
> if(isset($_POST["h"])){
> echo "<ul>\n";
> for($s=0;$s<count($h);$s++){
> if(isset($_POST["h"][$s]))
> echo "<li>\$_POST[\"h\"][{$s}] = {$_POST["h"][$s]}</li>\n";
> }
> echo "</ul>\n";
> }
> ?>
> <form method="post">
> <?php
> for($s=0;$s<count($h);$s++)
> echo "<input type=\"text\" name=\"h[{$s}]\" value=\"{$h[$s]}\">";
> ?>
> <input type="submit" value="Submit">
> </form>
>
I've used this and it sure works


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Message Subject
Next Topic: query: how many use PHP for linux scripts
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 05:42:24 GMT 2024

Total time taken to generate the page: 0.04196 seconds