Displaying all POST Paramaters

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shadowx360
Forum Newbie
Posts: 6
Joined: Sun Oct 10, 2010 3:53 pm

Displaying all POST Paramaters

Post by shadowx360 »

Hello, I'm just a beginner PHP programmer.

My question is that I have a file named reciever.php, and I'm working on this other web site. The function of reciever.php is to output all the POST parameters passed to it.

For example, if the POST request was:
[text]POST /test.php HTTP/1.1
Host: shadowx360.byethost4.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100405 Namoroka/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://www.testingsite.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 157
a=0&b=7&timestamp=16715189&user_id=138136845354381&command=7
HTTP/1.1 500 Internal Server Error
Date: Sun, 10 Oct 2010 20:22:49 GMT
Server: Apache
Cache-Control: no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform
Expires: Sun, 10 Oct 2010 20:22:49 GMT
Vary: Accept-Encoding,User-Agent
Pragma: no-cache
Content-Length: 0
Content-Type: text/html
X-Cache: MISS from demil1.byetcluster.com
Via: 1.0 demil1.byetcluster.com:80 (Lusca/LUSCA_HEAD-r14756)
Connection: close[/text]

I need it to output the "a=0&b=7&timestamp=16715189&user_id=138136845354381&command=7". If you know javascript, when I make a new XMLHttpRequest(), and then call http.send(params), I need it to give me the params part, all of the parameters passed to it. Using echo $_REQUEST doesn't work. Can anyone show me how this would be done?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Displaying all POST Paramaters

Post by Eran »

Code: Select all

var_dump($_POST);
Post Reply