Jump to content

Archived

This topic is now archived and is closed to further replies.

glenelkins

dynamic $_POST data

Recommended Posts

Hi

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

[code]
<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>
[/code]

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

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

any ideas people?? cheers

[!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--][b]ITS OK FOUND THE PROBLEM ON THIS LINE: <input type="text" name="email[$i]">[/b][!--colorc--][/span][!--/colorc--]

Share this post


Link to post
Share on other sites
What is it that you are exactly trying to make and then i can help?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.