Baffled by Undefined Index in Simple Array: Please Help!


Posted on 16th Feb 2014 07:03 pm by admin

Hello. I have a form which posts an array to this script. However, I can't seem to access the values in the array; I keep getting an undefined index. Something is not right, but the code is so simple! What am I missing?

print_r($_POST['Item'][0]);
// Output is: Array ( ['Quantity'] => 1 ['Item_id'] => 5 )
Did you know?Explore Trending and Topic pages for more stories like this.
echo $_POST['Item'][0]['Quantity'];
// Output is: Notice: Undefined index: Quantity in /Volumes/Macintosh HD/Sites/.../hal/item/reconcile.php on line 30
No comments posted yet

Your Answer:

Login to answer
76 Like 29 Dislike
Previous forums Next forums
Other forums

DB2 for z/OS, LUW, iSeries
Hello, In this forum a lot of threads related to other members of the DB2 family than DB2 for z/OS

problem with query error
First Thanks to those who helped me on my previous posts, and the following code i'm using is not mi

generating all possible random letters
hi'

how can i randomize the letters a,b,c,d,e all possible ways, and i want to print the res

Problem with umlauts and UTF-8
Hello every1,

I'm creating my own little CMS at the moment and got some problems with the cha

PHP Thumbnail Creation
Ok so i use this function to create thumbnails:

Code: [Select]function createthumb($name,$fil

Redistributing dependent dlls
Hai all ,

I have created an application in VC++ using VS2008 in a development machine which r

Filtering for a phrase using pregmatch
Here is my code which looks for addresses which start with ' src=" '

Code: [Select]preg_

recrawling
Can anyone suggest me how may i know a page is updated before it is being downloaded, so that i can

How to show next and prev records
Hi all,

Sorry if this is simple, i'm very new to php, well, any programming language actually

change text color with a jQuery code
Hihow can I change the text in a asp:TextBox to a different color when I start typing using jQuery?I

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash