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

do while conditions
i want to display 6 images in a 2x3 table
now what would be the correct logic to
count that th

Session problem?!?
Hello All! I am very new to the php world but I am working on fixing things that a previous programm

Could Someone Please Debug This?
I was wondering if someone could debug this script for me. I realize it's not the tidest script (and

Linkage between two scripts
Okay say I have this for a link in a script:

Code: <li><a href="#&q

Getting a variable to work in function params
I have this fuction which is inside a class:

Code: public static function generateEmbedCode($

Timer control causing error
I recently decided to add a timer control to an existing page that uses AJAX on my site. As soon as

How to update this array?
I am saving a string that looks this: username1, username2, username3...
into a single cell in a

While Problem
i am having a problem with a while statement here is the code
Code: [Select]<?php
sess

Accept only alpha characters
I've got this bit of code ready for accepting a phrase:

Code: if (!eregi ("", $_POS

php multiple action on submit
I have a form which says:

<form enctype='multipart/form-data' method='post' action='pr

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