Solved

Get all the $_post

Posted on 2009-05-04
3
226 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
[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
3 Comments
 
LVL 143

Accepted Solution

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

756 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