Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #13698

Re: How to get the POST name of a field in a form that uses a counter

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.php
Subject Re: How to get the POST name of a field in a form that uses a counter
Date 2014-05-15 01:19 +0000
Organization A noiseless patient Spider
Message-ID <ll14nm$998$6@dont-email.me> (permalink)
References <XnsA32DA68DB274Farbpenyahoocom@78.46.70.116>

Show all headers | View raw


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>

-- 
Denis McMahon, denismfmcmahon@gmail.com

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to get the POST name of a field in a form that uses a counter Adrienne Boswell <arbpen@yahoo.com> - 2014-05-14 23:22 +0000
  Re: How to get the POST name of a field in a form that uses a counter Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-15 02:15 +0200
  Re: How to get the POST name of a field in a form that uses a counter Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-15 01:01 +0000
  Re: How to get the POST name of a field in a form that uses a counter Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-15 01:19 +0000
    Re: How to get the POST name of a field in a form that uses a counter The Natural Philosopher <tnp@invalid.invalid> - 2014-05-15 03:29 +0100
  Re: How to get the POST name of a field in a form that uses a counter Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-05-15 02:55 +0100
  Re: How to get the POST name of a field in a form that uses a counter Arno Welzel <usenet@arnowelzel.de> - 2014-05-15 10:22 +0200
  Re: How to get the POST name of a field in a form that uses a counter Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-15 08:15 -0400
  Re: How to get the POST name of a field in a form that uses a counter Adrienne Boswell <arbpen@yahoo.com> - 2014-05-15 22:45 +0000

csiph-web