Solved

Need help requesting an array -

Posted on 2006-11-03
4
233 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
  • 2
  • 2
4 Comments
 
LVL 142

Accepted Solution

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

Author Comment

by:foreverdita
Comment Utility
I thought that would work as well.  But it still gives me blank values for the array.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
can you print out:

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

Author Comment

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

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

763 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now