hunter4854
01-11-2012, 09:46 PM
Ok, i have this code. Everything works, so i do not need it changed. I need to add a part where i can receive files. The name is datafile. i also need a validater for the email field i have been working on this, but i am completely stuck?!:( Please help me.
<?php
## CONFIG ##
# LIST EMAIL ADDRESS
$recipient = "huntermitchell386@gmail.com";
# SUBJECT (Contact Form/Remove)
$subject = "Contact Form";
# RESULT PAGE
$location = "thank_you.html";
## FORM VALUES ##
# SENDER
$email = $_REQUEST['email'] ;
# MAIL BODY
$body .= "First Name: ".$_REQUEST['first_name']." \n";
$body .= "Last Name: ".$_REQUEST['last_name']." \n";
$body .= "Email: ".$_REQUEST['email']." \n";
$body .= "Questions: ".$_REQUEST['comments']." \n";
# add more fields here if required
## SEND MESSGAE ##
mail( $recipient, $subject, $body, "From: $email" ) or die ("Mail could not be sent.");
## SHOW RESULT PAGE ##
header( "Location: $location" );
?>
<?php
## CONFIG ##
# LIST EMAIL ADDRESS
$recipient = "huntermitchell386@gmail.com";
# SUBJECT (Contact Form/Remove)
$subject = "Contact Form";
# RESULT PAGE
$location = "thank_you.html";
## FORM VALUES ##
# SENDER
$email = $_REQUEST['email'] ;
# MAIL BODY
$body .= "First Name: ".$_REQUEST['first_name']." \n";
$body .= "Last Name: ".$_REQUEST['last_name']." \n";
$body .= "Email: ".$_REQUEST['email']." \n";
$body .= "Questions: ".$_REQUEST['comments']." \n";
# add more fields here if required
## SEND MESSGAE ##
mail( $recipient, $subject, $body, "From: $email" ) or die ("Mail could not be sent.");
## SHOW RESULT PAGE ##
header( "Location: $location" );
?>