Thanks to all for the responses, including the warning and caveats!

I want to move forward with this project, even with my lack of HTML
experience. I'm waiting for the HTML developer to get freed up - I want to
test my plumbing code.


On Mon, Feb 18, 2013 at 10:07 AM, Mark Murphy/STAR BASE Consulting Inc. <
mmurphy@xxxxxxxxxxxxxxx> wrote:

Once more, with feeling this time.

I believe that your question is how do I load an array into the $_POST
variable from a form. The answer is in the naming of your input fields.
If you append an [] to the end of each field, then all the fields named
the same will form an array. So ... use <input name="col1[]">.

<table>
<tr>
<td><input name="col1[]"></td>
<td><input name="col2[]"></td>
...
</tr>
<tr>
<td><input name="col1[]"></td>
<td><input name="col2[]"></td>
...
</tr>
<tr>
<td><input name="col1[]"></td>
<td><input name="col2[]"></td>
...
</tr>
</table>

This will return the following arrays in $_POST (assuming the form method
is POST): col1, col2, ...


Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----web400-bounces@xxxxxxxxxxxx wrote: -----
To: "Web Enabling the AS400 / iSeries" <web400@xxxxxxxxxxxx>
From: Michael Ryan
Sent by: web400-bounces@xxxxxxxxxxxx
Date: 02/15/2013 10:56AM
Subject: [WEB400] Best Practice to Send Data to i

I need to send a bunch of data to the i using PHP. I'm reworking a 5250
subfile program that presents a data entry subfile to the user. The user
enters information into the subfile fields, presses enter, and the program
then processes each entry in the subfile.

I want to do this process in HTML and PHP. I'm thinking of displaying an
HTML table and then processing each row when the user POSTs the data. I
want to call a stored procedure to validate the data in each row.

My first thought would be to send all the data to the stored procedure as a
series of arrays, one for each column in the . The RPG developer (who will
write the code that will become the stored procedure) is looking for
basically a MODS as input. I want to keep the validation SP accessible from
both RPG and PHP.

Any ideas? Thanks!
--

This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.