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

How to change www in url with a specified name
Hi
I'm trying to change the url http://www.sitename.com/apparels to something like below
http:

please fix the error
What is the error in the below code ???
Line number On/Off | Expand/Contract <?php

remove trailing slash from array
I have the following array which contains trailing slashes I need to remove. What is the best way to

PHP - MySQL Fail
My PHP code will only execute the first part of my code...

Code: <?php

sessio

Packet Design
Hi All,
Im new about network programming and I want to design a protocol but I have some question

Hashing?
Hi, I was hoping to take a string value then convert it - consistently - across each of our pages in

Warehouse Management
Hi,

On our system, we have two storage locations ( A and B ) where A is the main factory

Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out wh

Simple Scraper... Weird Output
Okay, maybe I just need a Blue Monster and some sleep, but....

I'm scraping a ringtone site

use an array from 1 class in a second class
I have a class that adds data to an array

Then I have a second class and I need to check if t

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