Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need help requesting an array -

Posted on 2006-11-03
4
Medium Priority
?
284 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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
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 …
Suggested Courses

886 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