Can someone help me/design me a PHP contact form for this HTML?

Can someone design me a contact form in PHP for this HTML form? Just need it to send data, then redirect to a thanks.html page.


<!-- Contact -->
		<div class="article">
			<h2>Contact me?</h2>
			<form action="email.php">
				<div class="cl">&nbsp;</div>
				<div class="column-cnt">
					<div class="cl">&nbsp;</div>
					<div class="column">
						<label for="name">Your Name?</label>		
						<span class="text-field"><input type="text" id="name" value="" />	</span>			
					</div>					
					<div class="column">
						<label for="email">Your E-mail address?</label>		
						<span class="text-field"><input type="text" id="email" value="" /></span>				
					</div>		
					<div class="cl">&nbsp;</div>
					<p>You can call me anytime for a quote on <strong>07801233070</strong>. Alternatively, you can use the contact form below and I will get back to you usually within 12-24 hours! My web design prices are usually cheap and I can cater for just about anyones needs!</p>											
				</div>
				<div class="column-big">
					<label for="message">Your Message</label>		
					<span class="text-area"><textarea id="message" rows="" cols=""></textarea>	</span>		
					<input type="submit" value="Send Email">
				</div>	
				<div class="cl">&nbsp;</div>
			</form>
		</div>
		<!-- End Contact -->

PHP is not my strongest language and when I have tried, it sends the email but does not contain anything!

It wont send anything because you haven’t named any of your fields…


<input type="text" id="usr_name" name="usr_name" value="" />

Without a name the PHP mail script cant get the values to send.

Oh my god someone please tell me why I read over this a thousand times looking for errors and looked at id=“name” for the name of the box! God dammit thankyou!

Any chance you can create me a simple PHP script that will send an email laid out like this in the message body?


Name: John Doe
Email: johndoe1@live.co.uk

Message text here

And for the subject to be “Contact Form Submission - John Doe”
I would like for it to echo the name of the person submitting it in the email subject after Contact Form Submission.

Many thanks!

change the email addresses and form NAMES as appropriate


$usr_name = $_POST['user_name'];
$usr_email = $_POST['usr_email'];
$usr_message = $_POST['usr_message'];

$to = 'you@youremail.com';
$subject = "Contact Form Submission - $usr_email";


$msg = "
Name: $usr_name
Email:$usr_email

Message: $usr_message
";

$headers = "From: myplace@here.com\\r\
";
$headers .= "Reply-To: myplace2@here.com\\r\
";
$headers .= "Return-Path: myplace@here.com\\r\
";
$headers .= "CC: sombodyelse@noplace.com\\r\
";
$headers .= "BCC: hidden@special.com\\r\
";


mail($to, $subject, $msg, $headers);

header("Location: thanks.html");
exit();

Haha legend mate, thanks very much!

Edit got it working thanks!