• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Need help requesting an array -

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
foreverdita
Asked:
foreverdita
  • 2
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
$id = $REQUEST['id'];
echo $id[9];
0
 
foreverditaAuthor Commented:
I thought that would work as well.  But it still gives me blank values for the array.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
can you print out:

print_r ( $REQUEST['id']);
0
 
foreverditaAuthor Commented:
Duh - my own fault.  I forgot the _ on my $REQUEST

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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now