How about indexing those names? This works pretty well:

<?php
echo "<pre>";
print_r($_POST);
echo "</pre>";
?>

<form method="post">
        <input name="data[0]" value="1" />
        <input name="data[1]" value="2" />
        <input name="data[2]" value="3" />
        <input type="submit" />
</form>

It prints this on submit:

Array
(
    [data] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

)

More on that topic here:
http://si2.php.net/manual/en/language.variables.external.php

Jörn

On Tue, Jun 24, 2008 at 11:30 AM, Aaron Heimlich
<[EMAIL PROTECTED]> wrote:
> On Tue, Jun 24, 2008 at 3:52 AM, Jörn Zaefferer
> <[EMAIL PROTECTED]> wrote:
>>
>> So I recommend to rethink your serverside. After all, the
>> square-bracket notation is just a handy convention
>
> A handy convention that PHP just happens to transform into an *actual* array
> on the server-side. So, IMO, he'd end-up making his server-side coding more
> complicated in order to accommodate the limitations of your plugin. Example:
> <input id="date1" name="date[]" class="required" size="10"
> value="2008-06-24" type="text" />
> <input id="date2" name="date[]" class="required" size="10"
> value="2008-06-25" type="text" />
> <input id="date3" name="date[]" class="required" size="10"
> value="2008-06-26" type="text" />
>
> <?php
> $dates = $_REQUEST['date'] // you really should use $_GET or $_POST, but I
> don't know which method owen's using here
> foreach($dates as $i => $date) {
>     echo "date $i is $date\n";
> }
> // date 0 is 2008-06-24
> // date 1 is 2008-06-25
> // date 2 is 2008-06-26
> ?>
>>
>> , but nothing you couldn't achieve in a different way.
>
> I'm curious as to what those ways are (honestly). Example?
> --
> Aaron Heimlich
> Web Developer
> [EMAIL PROTECTED]

Reply via email to