Jump to content

I need help with form submit by email....thx


sonehs

Recommended Posts

Look at www.tritusco.com/contactus.html  The code below is supposed to help me submit the form into a email.  I'd also like help figuring out just how I would make it so the subject of the email is which ever box is checked.

 

Thx for the help

 

 

<?php

// Check for form submission:
if(isset($_POST['submitted'])) { 

// Minimal form validation:

if(!empty($_POST['name'])&&
   !empty($_POST['email']) &&
   !empty($_POST['phone']) &&
   !empty($_POST['message'])) {

	// Create the body:

	$body = "Name:$_POST['name']}\nPhone:$_POST['phone']}\n\nMessage:$_POST['message']}";

	//  Make it no longer then 70 characters long:


		$body = wordwrap($body, 70);

		// Send the email

		mail('[email protected]', 'Contact Form Submission', $body, "From: {$_POST['email']}");

		// Print a message:

		echo '<p><em>Thank you for contacting us.  We will get back to you soon.</em></p>';

		// Clear $_POST (so that forms not sticky):

		$_POST = array()
	} else {
			echo '<p style="font-weight: bold; color: #C00">Please fill out the form completely.</p>';

	}

	} 




?>

I see your form on http://www.tritusco.com/contactus.html and the radio buttons for 

 

Services  Partnership

Media Join Team

 

There is however no information on your form processing to grab the information for these fields.  We'd need to know what the name of these radio buttons are so you can grab the variables as $_POST[var] to use it in the email submission.

 

The best bet is for you to post up the code for your form itself.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.