PDA

View Full Version : Form post email user


nytrixxx
03-22-2006, 02:37 PM
Hello eveyone! I have a registration form setup and posting to my MySQL database, which is working perfectly. The one thing left I have to do is setup the form information to be sent to the users that fill out the form, with hidden text that appears in the email saying "Thank you for your registration, please print out this email and bring it along to the seminar to be eligilble for door prizes" and so on. In the form they fill in there email which I was hoping could be linked into the submit button or some sort of hidden field setup. I am currently using PHP MySQL.

Anyone have any ideas?



<body>
<div align="center"></div>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>../images/Template/CAAP/UndockedHeaders/Tractor.jpg</td>
</tr>
<tr>
<td><form action="<?php echo $editFormAction; ?>" method="POST" name="Register" id="Register" onSubmit="MM_validateForm('firstName','','R','middleName','' ,'R','lastName','','R','address','','R','city','', 'R','state','','R','zip','','RisNum','major','','R ','email','','NisEmail');return document.MM_returnValue">
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF"><fieldset><legend>Register</legend>



<label>First Name
<input name="firstName" type="text" id="firstName" size="25" maxlength="30">
</label>
</p>



<label>Middle Name
<input name="middleName" type="text" id="middleName" size="25" maxlength="30">
</label>
</p>



<label>Last Name
<input name="lastName" type="text" id="lastName" size="25" maxlength="30">
</label>
</p>



<label>Present Address
<input name="address" type="text" id="address" size="40" maxlength="50">
</label>
</p>



<label>City
<input name="city" type="text" id="city" size="25" maxlength="30">
</label>
</p>



<label>State
<input name="state" type="text" id="state" size="4" maxlength="2">
</label>
<label>Zip code
<input name="zip" type="text" id="zip" size="8" maxlength="8">
</label>
</p>



<label>Current Major
<input name="major" type="text" id="major" size="30" maxlength="35">
</label>
</p>
</fieldset>
<blockquote>
<fieldset>
<label>Valid Email Address
<input name="email" type="text" id="email" size="28" maxlength="30">


<span class="style2">(Make sure to provid a valid email address to be eligible for door prizes) </span></label>



<label>
<input type="submit" name="Submit" value="Submit">
</label>
<label>
<input type="reset" name="Reset" value="Clear Form">
</label>
</p>
</fieldset>
</blockquote> </td>
</tr>
</table>

<input type="hidden" name="MM_insert" value="Register">
</form></td>
</tr>
<tr>
<td></td>
</tr>
</table>
<div align="center"></div>
</body>

davidj
03-22-2006, 03:29 PM
are you wanting to know how to email using PHP

http://www.dreamweaverclub.com/dreamweaver-php-form.php

kona72
03-22-2006, 06:34 PM
You could set up a seperate page with the sendmail.php script and just put an include in this code..

Jim_Shady
03-22-2006, 07:52 PM
are you wanting to know how to email using PHP

http://www.dreamweaverclub.com/dreamweaver-php-form.php

Apologies for a bit of cross posting - but I tried this and it doesn't seem to have worked - would you mind taking a glance David?

http://www.mgf-labs.com/ContactUs.htm

My PHP looks like this...

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Enquiry from website';

// Your email address. This is where the form information will be sent.
$emailadd = 'mye-mail@gmail.com';

// Where to redirect after form is processed.
$url = 'http://www.mgf-labs.com/confirmation.htm';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>
</body>
</html>