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

x
?
Solved

Get all the $_post

Posted on 2009-05-04
3
Medium Priority
?
230 Views
Last Modified: 2012-05-06
How can i retrieve all variables posted through $_post
i dont know how many will be passed everytime the post is submitted i only
know they will be named like this:
itemid_456
itemid_7874
itemid_4841
itemid_4843
etc...
0
Comment
Question by:CMDAI
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 24293753
you can loop in the $_POST array... and then check the key name
foreach($_POST as $key => $value)
{
   // check name here, using $key value
 
}

Open in new window

0
 
LVL 4

Expert Comment

by:max-hb
ID: 24293760
Maybe simply iterate through all available post vars?!

<?php
echo "<pre>";
foreach($_POST as $key => $value) {
  echo "Variable $key has value(s):<br/>";
  print_r($value);
}
?>
Regards
 Marc

0
 
LVL 1

Author Closing Comment

by:CMDAI
ID: 31577490
thanks
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

916 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