Jump to content


Photo

dynamic $_POST data


  • Please log in to reply
1 reply to this topic

#1 glenelkins

glenelkins
  • Members
  • PipPipPip
  • Advanced Member
  • 760 posts
  • LocationBridlington - East Riding of Yorkshire - United Kingdom

Posted 28 May 2006 - 11:53 AM

Hi

Ok I have created a quick test script (below) to create 10 dynamic text boxes and a submit button:

<form name="test" action="test2.php" method="post">
<table>
    <?
    for ($i=0;$i<10;$i++){
        ?>
        <tr>
            <td>
                Email:
            </td>
        </tr>
        <tr>
            <td>
                <input type="text" name="email[$i]">
            </td>
        </tr>
        <?
    }
    ?>
<tr>
    <td>
        <input type="submit" name="button" value="Submit">
    </td>
</tr>
</table>
</form>

Now, how do i get the information from each text box?? I tried the following but dont seem to work:

foreach ($_POST[email] as $email) {
    echo $email . "<br>";
}

any ideas people?? cheers

[!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--]ITS OK FOUND THE PROBLEM ON THIS LINE: <input type="text" name="email[$i]">[!--colorc--][/span][!--/colorc--]
http://thewebsolutionprovider.com - A Solution For Everything Web!

#2 perezf

perezf
  • Members
  • PipPipPip
  • Advanced Member
  • 301 posts
  • LocationFort Lauderdale

Posted 28 May 2006 - 11:59 AM

What is it that you are exactly trying to make and then i can help?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users