Jump to content
Stef's Super Nerd Community
Sign in to follow this  
grucker

Sending Form Information

Recommended Posts

I have a few forms that send to a database and then I pull the information posted to a web page. I have many forms that send an email message. How is it possible to send one form to both database and email.

Regards

David

Share this post


Link to post
Share on other sites

Essentially, you just have to add the mail function last, after the submission to your database. See if you can work it out from here to suit your code:-


  $result=MYSQL_QUERY("INSERT INTO villagehall (id, day, month, year,date,starttime, endtime, club, room, who, phone, email, message, book)".
     "VALUES ('NULL', '$day', '$month', '$year', '$date', '$starttime', '$endtime', '$club1', '$room' , '$who1',  '$phone1' , '$email1' , '$message1', '$book')")or die( "<p><span style=\"color: red;\">Unable to select table</span></p>");  
mysql_close(); 

mail( $email, "Village Hall booking", "$day/$month/$year $starttime to $endtime\r\n$room $book\r\n$club\r\n\r\n$replymsg", "From: $admin" );

header( "Location: $thankyouurl" );		
}

?>

 

The above is just part of the code. It's old mysql; I have updated my page to mysqli which is recommended now, but the code is a little bit more complicated as more than one parameter is often needed.

Share this post


Link to post
Share on other sites

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...
Sign in to follow this  

×
×
  • Create New...