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 )
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

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . dat

Php navigation
I have four buttons on a php page.
If i click a button it will redirect to different php pages.

Array help
Hello i got this code to fetch data from database but it is not working it displays
7
Array

Print out contents of to Excel
I have got this script that gathers all the data that I need but I need it to send it to excel inste

PHP webpage & array print issue
I have this code running, and it works perfectly … however, see my bottom bit about what I see

Help with ORDER BY
Hello. I would like to order by ascending States, then Cities, then Gyms in the following code, but

Remove Rows From Database ad
Hi All,

I have this:

Code: [Select]<?php
session_start();
include('../com

listing help
Hi,

at first, great new design!!! I like it,

i got a problem,

I want to list so

word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor

SESSION CHECK WORKS "MOST" of the time... whats going on?
i have a sign in check thats included in every page that is a members only page which is basically a

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