Data Dump V2
Data Dump V2 simply publishes all the data it receives or otherwise has available when the software is loaded in a browser — which includes when a form temporarily uses it as a thank-you or confirmation page.
The software is quite useful when testing forms. It is the easiest web page form testing software I have used. As indicated above, Data Dump V2 displays whatever information it receives.
Install a copy of Data Dump V2 on your server and have a wonderful testing tool available.
The first version of Data Dump was published in 2011. This second version added two information elements (form upload information and raw POST data).
Here is a short explanation of each information item that Data Dump V2 intercepts and publishes.
-
Method POST — When a form with
method="post"
is submitted to the data dump software, Data Dump V2 will display the form field names and their values. All form fields that are submitted are displayed, including hidden fields and, if applicable, button names and values. -
Method GET — Similar to method POST, when a form with
method="get"
is submitted to the data dump software, the received names and values are displayed. -
Uploaded FILE Data — When using a form to upload files (form field
type="file"
), the upload information is processed with a special$_FILES
array. Formtype="file"
fields can be single or multiple files; and may have unique or identical field names (with[]
appended). Data Dump V2 will display an array of all upload data (name, size, type, …), so any combination of form upload fields can be represented. -
Raw POST — When the form data is sent to the data dump software with method POST, but not formated as standard name=value information, then Data Dump V2 publishes a copy of what was submitted. (An example of unformatted information is server software submitting the data instead of a web page form — JSON-encoded data, an image file, or any other data not formatted as normal name=value pairs.)
-
Cookies — If the data dump software receives cookie information from the browser, the cookies are displayed.
-
Environment Variables — The PHP script maintains a number of environment variables. They are displayed here in case some of the information is useful. For example, it shows what method was used to submit the form.
<?php /* Raw Data Dump Version 1.1 August 15, 2023 Added uploaded FILES information and raw POST data information (Version 1.0 was published year 2011) Will Bontrager Software LLC https://www.willmaster.com/ */ $rawdata = file_get_contents("php://input"); ?><!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Data Dump V2</title> <style type="text/css"> * { box-sizing:border-box; } html { font-family:sans-serif; font-size:100%; } a { text-decoration:none; } .outside-value-box { display:table; border-top:2px solid black; border-bottom:2px solid black; border-left:2px solid black; border-top-left-radius:6px; border-bottom-left-radius:6px; padding:2px 0 0px 3px; margin:0 0 1em 0; overflow:auto; } .within-value-box { white-space:nowrap; padding:2px 0 2px 6px; border-top:1px solid black; margin-left:-3px; margin-top:1px; } h3 { margin-top:1.5em; } </style> </head> <body><div style="display:table; margin:.25in auto;"> <h1 style="font-weight:normal; letter-spacing:3px;">Data Dump <a href="https://www.willmaster.com/"><img src="https://www.willmaster.com/images/wmlogo_icon.gif" alt="Willmaster.com" title="Courtesy of Willmaster.com"></a></h1> <?php if( count($_GET) ) { echo('<h3>• Received data method GET —</h3>'); PrintValues($_GET); } else { echo('<h3 style="font-style:italic;">No method GET data received.</h3>'); } if( strlen($rawdata) ) { echo "<h3>• Raw POST Data:</h3>"; echo $rawdata; } else { echo('<h3 style="font-style:italic;">No raw POST data received.</h3>'); } if( count($_POST) ) { echo('<h3>• Received data method POST —</h3>'); PrintValues($_POST); } else { echo('<h3 style="font-style:italic;">No method POST data received.</h3>'); } if( count($_FILES) ) { echo('<h3>• Raw of received FILES data —</h3>'); echo '<pre>'.print_r($_FILES,true).'</pre>'; #PrintValues($_FILES); } else { echo('<h3 style="font-style:italic;">No FILES data received.</h3>'); } if( count($_COOKIE) ) { echo('<h3>• Cookies data —</h3>'); PrintValues($_COOKIE); } else { echo('<h3 style="font-style:italic;">No cookies received from browser.</h3>'); } if( count($_SERVER) ) { echo('<h3>• Environment variables —</h3>'); PrintValues($_SERVER); } function PrintValues(&$ar) { ksort($ar); foreach($ar as $k => $v) { $pk = htmlspecialchars($k); if( is_array($ar[$k]) ) { $counter = 0; $pkh = array(); foreach( $ar[$k] as $kk => $vv ) { if( empty($vv) ) { $pv = ' '; } else { $pv = htmlspecialchars($vv); } $pkh[$counter] = $pk.'['.$counter.']'."\t$pv"; $counter++; } foreach( $pkh as $tpk => $tpv ) { list($tk,$tv) = explode("\t",$tpv,2); echo "<div class='outside-value-box'>$tk"; echo "<div class='within-value-box'>$tv</div></div>"; } } else { if( empty($v) ) { $pv = ' '; } else { $pv = htmlspecialchars($v); } echo "<div class='outside-value-box'>$pk"; echo "<div class='within-value-box'>$pv</div></div>"; } } } ?> <p style="margin-top:50px;"> Copyright 2023 <a href="https://www.willmaster.com/">Will Bontrager Software LLC</a> </p> </body> </html>
Installation is copy and paste: Name the file datadump.php
or other preferred *.php
file name. Make a note of the installed software's URL.
To use, temporarily replace the action
value of your form tag with the URL of the installed Data Dump V2 software.
I think you will appreciate the data dump tool, especially if you do occasional or more website developing.
(This content first appeared in Possibilities newsletter.)
Will Bontrager