...

View Full Version : ~~Php Contact form code~~



hunter4854
01-11-2012, 10: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" );
?>

mlseim
01-12-2012, 03:59 AM
Way to difficult to explain using this forum ... so look at these:
https://www.google.com/search?q=php+contact+form+with+file+attachment



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum