This is a very simple PHP script that outputs the name of each bit of information (that corresponds to the name
attribute for that form field) along with the value that was sent with it right in the browser window.
In a more useful script, you might store this information in a MySQL database, or send it to your email address.
Note: The sample PHP code in this file is simple by design, but as a result, it doesn't include the security checks that a bulletproof script would include. Use caution before including it on your own site. If you do intend to use a script like this, I recommend consulting PHP books and other resources to learn how to check submitted form values for malicious data before you write the values to the screen or to a database.
Field Name | Value(s) | No data was submitted. | ";
} else { /* Data was submitted, so show it in the page. */
foreach ($_POST as $key => $value) {
/* Cleans up quoted values. See:
http://us2.php.net/manual/en/function.get-magic-quotes-gpc.php
http://us2.php.net/manual/en/function.stripslashes.php
*/
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
/* Check the form field and print its value in a table row */
if ($key == 'email_signup') { // True if one of the Email checkboxes at end
if (is_array($_POST['email_signup'])) { // True if a checkbox checked
// Print the name of the checkbox form field and the value
foreach ($_POST['email_signup'] as $value) {
print "
---|---|
$value | "; print "on"; print " |
$key | $value |
$key | $value |
picture | $picture_name |