Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-11-2012, 09:46 PM   PM User | #1
hunter4854
New to the CF scene

 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
hunter4854 is an unknown quantity at this point
Exclamation ~~Php Contact form code~~

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 Code:
<?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" );
?>
hunter4854 is offline   Reply With Quote
Old 01-12-2012, 02:59 AM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,046
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Way to difficult to explain using this forum ... so look at these:
https://www.google.com/search?q=php+...ile+attachment
mlseim is offline   Reply With Quote
Reply

Bookmarks

Tags
contact, form, html, php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:48 PM.


Advertisement
Log in to turn off these ads.