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('Jeff@TritusCO.com', '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>';

	}

	} 




?>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.