× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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!

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 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.