Published in: PHP
URL: http://blogs.adobe.com/stevex/2006/05/http_submit.html
I've created a simple PHP script that dumps out what you submit to it parsed (so you can see what variables PHP found in the submitted data) as well as the raw POST body.
http://blogs.adobe.com/stevex/2006/05/http_submit.html
<HTML> <HEAD> <TITLE>HTTP Request Dump</TITLE> </HEAD> <BODY> <h1>HTTP Request Dump</h1> This page sends back to you what your browser or other user-agent submitted to this page. <h2>HTTP Headers</h2> <pre> <?PHP DumpArray("HEADERS", emu_getallheaders()); ?> </pre> <h2>Submitted Variables (as parsed by PHP)</h2> <pre> <?PHP echo $content_type; DumpArray("REQUEST",$_REQUEST); ?> </pre> <h2>Raw POST Body</h2> <pre> <?PHP echo " bytes: <br>"; ?> <span style="background-color: #e0e0f0"> <?PHP echo "\n"; } echo $body; ?> </span> </pre> </BODY> </HTML> <?PHP # Function DumpArray ########################################################## function DumpArray($ArrayName,&$Array) { foreach ($Array as $Key=>$Value){ echo "$Key: $Value\n"; } # End of foreach ($GLOBALS as $Key=>$Value) } # End of function DumpArray ################################################# function emu_getallheaders() { foreach($_SERVER as $h=>$v) $headers[$hp[1]]=$v; $headers["CONTENT_TYPE"]=$_SERVER["CONTENT_TYPE"]; return $headers; } ?>
You need to login to post a comment.
