Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - Intercept POST requests

I was wondering if anyone could help me solve how to view $_POST requests.

What i want to do, is check all $_POST requests, not just certain ones like $_POST['name'], $_POST['post'] etc, I'd like to check every post, without being able to know the name of each POST request.

Here is what i've tried (snippet):

foreach ($_POST as $pst)
{
    echo $pst;
}
//And tried the above for GET too. (but the GET I've manged to working.)

I've also tried many others, that i can think off an can come to no resolution...

like image 476
RobAtStackOverflow Avatar asked Dec 10 '25 09:12

RobAtStackOverflow


1 Answers

You used the right solution

foreach($_POST as $key=>$value){
    //> do your operation here
    echo $key.': '.$value;
}

You can use $key to get the param name

like image 171
dynamic Avatar answered Dec 12 '25 23:12

dynamic