Any help would be wonderful
Multi Purpose Form Problems with SQL
Moderator: General Moderators
Multi Purpose Form Problems with SQL
Any help would be wonderful
Actually fairly simple. Once you add the information to the database, then send an email. Example:
Hope that helps. (kinda took the code and diced it up a bit. Just an example)
Code: Select all
<?
$sql = "INSERT INTO table SET information_etc ='$information_etc";
if(@mysql_query($sql)) {
$from="support@email.com";
$to="$form_email";
$message="this is your message. Add $form_variables_here_also";
$message = stripslashes ($message);
if(mail($to,"subject",$message,"From: $from")) {
echo ("email sent");
} else {
echo ("There was a problem sending the mail.");
}
echo ("Confirm message here. added to database");
} else {
echo("Error adding > " . mysql_error() . " < that error");
}
?>I see
That looks good, but out of curiosity, which line exactly submits the email?
I see you spell out the to from subject content parts but shouldn't there be an execute statement that sends it? Or is that what happens when you evaluate it with:
if(mail($to,"subject",$message,"From: $from")) {
Using email with php is something I haven't much experience with, yet, so I really appreciate your help. I'm sure this will be enough to continue my research on the subject.
Thank you!
I see you spell out the to from subject content parts but shouldn't there be an execute statement that sends it? Or is that what happens when you evaluate it with:
if(mail($to,"subject",$message,"From: $from")) {
Using email with php is something I haven't much experience with, yet, so I really appreciate your help. I'm sure this will be enough to continue my research on the subject.
Thank you!