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

passing an array of objects after submit
How do I do this? This is what I have tried and it is not working.

<form method="

session_destroy();
new to php
I have a simple login and am trying to write a logout.
I set a $_SESSION var to 1 i

Problem with PHP code- simple contact form
Hi Folks,
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a co

how to insert value
I am having file bookissueadd.php..... in which i am having tag

<td height="21&q

FTP Programs
Here is a list of commonly suggested FTP Programs to use:

FileZilla
SmartFTP
CuteFTP

How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor

FPDF Help
I've been playing with the FPDF module. I was building a form and rolling right along and then sudde

Grouping and sorting results
Please help with this query.

I have 2 tables in a database, countires and cities. states look

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

max function question
Hi All
Ihave a table that holds shipment numbers and dates like this

select * from

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