How to capture Post Variables?
Posted: Sat May 27, 2006 5:37 am
I am posting from one page to another a list of products
at present I passing through the name,Price,Unit,and Quantity. I want to capture the list in an array.
I want the array to store the products together in the array. I have only a basic understanding of arrays as I have never really used them much before.
I want the be able to store them in an array called $fishlist.
I want to be able to access $fishlist[0] and be able to access the name,price,unit and quantity ordered.
currently I have this when I use the print_r command. how to i loop though and add the 4 parts of the individual fish into a group in the array and how then would i be able to access them later?
Array
(
[FishName_9] => Blue Prawn
[FishPrice_9] => 40.00
[FishUnit_9] => KG
[FishID_9] =>
[FishName_1] => Hoki
[FishPrice_1] => 12.00
[FishUnit_1] => KG
[FishID_1] =>
[FishName_2] => Sol
[FishPrice_2] => 15.00
[FishUnit_2] => KG
[FishID_2] =>
[blacboardorder] => Submit Order
[ck_csv] => Array
(
[serverName] => localhost
[username] => ********
[password] => ********
)
[PHPSESSID] => 1dde1bb83c8926818edb22fba3acff37
)
at present I passing through the name,Price,Unit,and Quantity. I want to capture the list in an array.
I want the array to store the products together in the array. I have only a basic understanding of arrays as I have never really used them much before.
I want the be able to store them in an array called $fishlist.
I want to be able to access $fishlist[0] and be able to access the name,price,unit and quantity ordered.
currently I have this when I use the print_r command. how to i loop though and add the 4 parts of the individual fish into a group in the array and how then would i be able to access them later?
Array
(
[FishName_9] => Blue Prawn
[FishPrice_9] => 40.00
[FishUnit_9] => KG
[FishID_9] =>
[FishName_1] => Hoki
[FishPrice_1] => 12.00
[FishUnit_1] => KG
[FishID_1] =>
[FishName_2] => Sol
[FishPrice_2] => 15.00
[FishUnit_2] => KG
[FishID_2] =>
[blacboardorder] => Submit Order
[ck_csv] => Array
(
[serverName] => localhost
[username] => ********
[password] => ********
)
[PHPSESSID] => 1dde1bb83c8926818edb22fba3acff37
)