Location: PHPKode > scripts > Simple Form - Emails Out > simpleForm/form.php

/* This form was created by derekmcdaniel.net and in order to use this form, I request that you keep this
copyright in the form. This can be used for personal use for but request a $5 donation to use it in a 
corporate environment

This form gets the following basic information:


It then sends out the email in a basic form to your email address set in the configuration file

Version 0.1

// This must be filled out first or the form will not work properly

// This will be used for future versions to come
$error = "";

if (array_key_exists('_submit_check', $_POST)) {

$name = $_POST['name'];
$emailAddress = $_POST['email'];
$message = $_POST['message'];

$email = "Name: $name<br />";
$email .= "Email: $emailAddress<br />";
$email .= "Message: $message<br />";

// Sends email
mail( $recip, $subject, $email, $headers );

// This defines what is displayed to the user after they submit a form
$sent = "<h3>Thanks for contacting us. We will be in contact shortly";

// End of Submit Check


echo "$error<br />";



echo $sent;


<form name="frmRequest" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Name: <input type="text" name="name" value="" size="30" /><br />
Email: <input type="text" name="email" value="" size="30" /><br />
Message: <textarea name="message"></textarea><br />
<input type="submit" name="Submit" value="Submit" />
<input type="hidden" name="_submit_check" value="1"/>
<?php } ?>
Return current item: Simple Form - Emails Out