Jump to content

Recommended Posts

Posted (edited)

I have an email form that I have used for awhile. The php process page sends the form data to whoever is listed in the webmaster email. It work fine. I need to add a confirmation email within the script so that whoever fills out the form. Any suggestions? Here is the register.process.php script.

<?php
/* subject & email veriables */

$webMaster = 'dgow@simplewebs13.com';


/* date veriables */
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$interest = $_REQUEST['interest'];
$date = $_REQUEST['date'];
$message = $_REQUEST['message'];

$body = <<<EOD
<table width="500">	
<tr><td>
	Class Registration Submission Form
<td><tr>
</table>
<br><hr><br>
<table width="500">
<tr><td style="width: 160px"/>Full Name:<td/>$name </tr>
<tr><td style="width: 160px"/>Email:<td/>$email </tr>
<tr><td style="width: 160px"/>Phone Number:<td/>$phone <tr/>
<tr><td style="width: 160px"/>Class Registration:<td/>$interest <tr/>
<tr><td style="width: 160px"/>Class Date:<td/>$date <tr/>
<tr><td style="width: 160px"/>Special Instructions:<td/>$message <tr/>
</table>
<br><hr><br>
<table width="500">
<tr><td>
	<font style="font-family: Arial, Helvetica, sans-serif; font-size: x-small; color: gray; ">&copy Copyright 2013 - <a href="http://company.com">company.</a> All Rights Reserved.</font>
<td><tr>
</table>
EOD;

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $interest, $body, $headers);

include ('register.success.php');

?>

Edited by dgow13
Posted (edited)

Fixed it. I added $email = '$email'; to the top of the form and $success = mail($email, $interest, $body, $headers); to the bottom.

 

<?php
/* subject & email veriables */
$webMaster = 'dgow@simplewebs13.com';
$email = '$email';


/* date veriables */
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$interest = $_REQUEST['interest'];
$date = $_REQUEST['date'];
$message = $_REQUEST['message'];

$body = <<<EOD
<table width="500">	
<tr><td>
	Point Blank CHL Class Registration Confirmation
<td><tr>
</table>
<br><hr><br>
<table width="500">
<tr><td style="width: 160px"/>Full Name:<td/>$name </tr>
<tr><td style="width: 160px"/>Email:<td/>$email </tr>
<tr><td style="width: 160px"/>Phone Number:<td/>$phone <tr/>
<tr><td style="width: 160px"/>Class Registration:<td/>$interest <tr/>
<tr><td style="width: 160px"/>Class Date:<td/>$date <tr/>
<tr><td style="width: 160px"/>Special Instructions:<td/>$message <tr/>
</table>
<br><hr><br>
<table width="500">
<tr><td>
	<font style="font-family: Arial, Helvetica, sans-serif; font-size: x-small; color: gray; ">&copy Copyright 2013 - <a href="http://company.com">company.</a> All Rights Reserved.</font>
<td><tr>
</table>
EOD;

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $interest, $body, $headers);
$success = mail($email, $interest, $body, $headers);

include ('register.success.php');

?>

Edited by dgow13
Guest noahwilson
Posted

Thanks to share a useful script, really that was need of me. thank a lot to share.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...