Location: PHPKode > scripts > Simple Form - Emails Out > simpleForm/form.php
<?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:

Name
Email
Message

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
require_once('configuration.php');

// 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
}

if(isset($error)){

echo "$error<br />";
exit();

}

if(isset($sent)){

echo $sent;

}elseif(!isset($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"/>
</form>
<?php } ?>
Return current item: Simple Form - Emails Out