Solved

Need help requesting an array -

Posted on 2006-11-03
4
276 Views
Last Modified: 2011-09-20
I have a form (not my form, a pre-packaged shopping cart which I am not able to change the functionality of without starting entirely from scratch)

It submits several values, including one that is submitted as an array.

<select name="id[9]">

and

<select name = "id[10]">

etc.

OK.  So I got the rest of the form values to work, but I cannot get the values of the ids to come across.  If I $REQUEST['id[9]'], I get no value.

If I request just id, I get a value = Array

Does anyone know how I can request the actual values of the array called ID?

Thank you in advance for your help.  This one really stumps me.
0
Comment
Question by:foreverdita
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 17867544
$id = $REQUEST['id'];
echo $id[9];
0
 

Author Comment

by:foreverdita
ID: 17867587
I thought that would work as well.  But it still gives me blank values for the array.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17867605
can you print out:

print_r ( $REQUEST['id']);
0
 

Author Comment

by:foreverdita
ID: 17867609
Duh - my own fault.  I forgot the _ on my $REQUEST

This worked like a charm.  Thank you!!!!!!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question