Forum Moderators: coopster

Message Too Old, No Replies

How to add an email to this.

         

Simone100

9:01 am on Jan 16, 2007 (gmt 0)

10+ Year Member



Hi, I have a form that goes to mysql when a submit button is pushed. How to make some of the form fields go to an email at the same time. For example an easy summary of it:

<?php
If post then {
?>
form fields
<form action="<?php $_SERVER['PHP_SELF'] ;?>" method='post'>
<input fields here>
type='submit' name='Submit' value='Submit'>
</form>
<?php
}
else {
$con = mysql_connect("mysql","databasename","password");
$sql="INSERT INTO etc.
if (!mysql_query($sql,$con))
{die('Error: ' . mysql_error());}

This is where I get stuck. Where to add the email fields. So that some of the above form fields will send to the email as well. I tried......
else {
$mailto = etc. and so on here.
echo "form fields sent";}}
?>

But it says unexpected Telse on the last else. Thanks.

Simone100

10:00 am on Jan 16, 2007 (gmt 0)

10+ Year Member



Problem fixed, thanks.

jatar_k

12:49 pm on Jan 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I am assuming mismatched braces

glad you fixed it