473,770 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Processing data from multiple multi-line textareas into a multi-dimensional array

I know that this sounds like something overly complex - because it is.
However, if I can keep the user interface the way it is, my users will
be ultra happy! That is the goal...

In general, this is an inventory receiving piece of an overall larger
web-based ERP system.

What I have is a form in which I have a dynamic number of multline
textareas for inputting (possibly barcode scanning in) many serial
numbers per lineitem recieved.

For example:
lineitem01 = widget01; qtyReceived = 2;
lineitem02 = widget02; qtyReceived = 3;
lineitem03 = widget03; qtyReceived = 10;

This would display a form that will generate 3 textarea elements (1
per lineitem received). Inside each textarea element will be input the
serial numbers for each of the widgets received per lineitem. i.e. 2
serial numbers will be entered for widget01; 3 for widget02; and 10
for widget03;

So, what I am trying to do is pass this data over, possibly as a multi-
dimensional array to another form ( or possibly
$_SERVER['PHP_SELF'] ) to update a MySQL database to store the widget/
serial numbers.

Any ideas at all on how to approach this problem are welcomed.

Thanks.

Mar 20 '07 #1
1 2979
On Mar 20, 3:00 pm, "phpCodeHea d" <phpcodeh...@gm ail.comwrote:
I know that this sounds like something overly complex - because it is.
However, if I can keep the user interface the way it is, my users will
be ultra happy! That is the goal...

In general, this is an inventory receiving piece of an overall larger
web-based ERP system.

What I have is a form in which I have a dynamic number of multline
textareas for inputting (possibly barcode scanning in) many serial
numbers per lineitem recieved.

For example:
lineitem01 = widget01; qtyReceived = 2;
lineitem02 = widget02; qtyReceived = 3;
lineitem03 = widget03; qtyReceived = 10;

This would display a form that will generate 3 textarea elements (1
per lineitem received). Inside each textarea element will be input the
serial numbers for each of the widgets received per lineitem. i.e. 2
serial numbers will be entered for widget01; 3 for widget02; and 10
for widget03;

So, what I am trying to do is pass this data over, possibly as a multi-
dimensional array to another form ( or possibly
$_SERVER['PHP_SELF'] ) to update a MySQL database to store the widget/
serial numbers.

Any ideas at all on how to approach this problem are welcomed.

Thanks.
If you display the form like this:

<input type=hidden name=lineitems[] value="widget01 ">
<textarea name="widget01" ></textarea>
<br><br>
<input type=hidden name=lineitems[] value="widget02 ">
<textarea name="widget02" ></textarea>
<br><br>
<input type=hidden name=lineitems[] value="widget03 ">
<textarea name="widget03" ></textarea>

Then when you post the data you can loop through the lineitems array
and get the entry for each textarea by using the value of the lineitem
like so:

foreach ($_POST['lineitems'] as $lineitem) {
$serial_text = $_POST[$lineitem];
$serials = explode("\n", $$serial_text);

// do whatever you need to do with each element serial for this
widget
// you also would want to trim() each item in the $serials array
before using it in case it has a left over \r in it
}

Hope this is answering the right question you had.

Mar 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2953
by: Michael Hill | last post by:
If I had a page that was being generated using coldfusion from queries to an oracle table would it be better response time: A) pulling the all the data using 1 query and iterating over the same result table multiple time producing desired arrays, or B) pulling specific data using specific queries with less production of arrays and proccessing after te data was returned? In the example I had 2 date fields called start and comp in a table...
6
1890
by: S P Arif Sahari Wibowo | last post by:
Hi! I am thinking to have a client-side script doing processing on file downloading, basically the script will process a downloaded file from the server before it received by the user. For example, the weboage will have a link to download file A, but the one stored in the server is not exactly file A, but some transformation of it. If the user click the link, it activate the script which will actually load the file from the server,...
10
1978
by: Rich Wallace | last post by:
Hey all, I have an XML doc that I read into a SQL Server database from an integration feed.... ----------------XML snippet ---------------- <?xml version="1.0" encoding="us-ascii"?> <!--Product data from JDEdwards--> <Root> <Root RvcDate="2004-02-03" RcvTime="14.16.03.795135">
2
2899
by: Paul J. Lay | last post by:
BlankThere are a number of good examples illustrating how an http client can send http mulipart/form-data files to a server using the dotnet.framework.aspnet support. I haven't been able to find a good example of client side processing of multiple downloaded files. I believe the content type is APPLICATION/OCTET-STREAM. Can you point me to a good example of this? Our application must be able to send and receive multiple files in one stream. ...
1
1011
by: kat | last post by:
Hi, I am pretty new to understanding how distributed applications work, and I just want to understand the flow of a single request. When a request is made that requires information from n-tiers, does the website pause to wait for it to go to all the tiers? So if a request had to make multiple queries to a database on a different system would all those queries have to complete before the request would return? Thanks,
1
1987
by: Lyners | last post by:
I am trying to figure out the best way to do this (currently I am having a problem sorting). I have a vb.net program that contains 2 datagrids on a form for the end user. When the user is ready to process, behind the scenes, I combine the 2 datagridas into a datatable, sort and do processing for creating a load into another system. My problem is that when I combine the two datagrids into the 1 datatable, I can only sort in a dataview. When...
7
1549
by: B. Williams | last post by:
I wrote a program that would simply output data to the screen, but now I am trying to have the data saved to a file. I don't have a problem creating the file or even outputting data to it when there is no header file to include, but I can't seem to figure out how to output the data to the file I create when the main is in a different. Will someone give me an example or show me what I am doing wrong? #include <iostream> #include...
6
3013
by: surfivor | last post by:
I may be involved in a data migration project involving databases and creating XML feeds. Our site is PHP based, so I imagine the team might suggest PHP, but I had a look at the PHP documentation for one of the Pear modules for creating XML and it didn't look like much. I've used Perl XML:Twig and I have the impression that there is more Perl stuff available as well as the Perl stuff being well documented as I have a Perl DBI book, a Perl...
0
17541
ADezii
by: ADezii | last post by:
In the Tip of the Week #19, we demonstrated Transaction Processing, specifically as it applies to DAO (Data Access Objects). In this week's Tip, we'll illustrate how Transaction Processing can be used within the context of ADO (ActiveX Data Objects). Please refer to the Link below if you wish to see an Overview of Transaction Processing, how it is implemented within DAO, or special issues to be aware of when utilizing Transaction Processing in...
0
2031
by: tavares | last post by:
(Our apologies for cross-posting. We appreciate if you kindly distribute this information by your co- workers and colleagues.) *************************************************************************** Symposium “Image Processing and Data Visualization” 2nd South-East European Conference on Computational Mechanics (SEECCM 2009) Island of Rhodes, Greece, 22-24 June 2009
0
9453
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.