cfwd
asked on
How to get action script to both post to email and post to table
I am trying to create a php form with Dreamweaver MX that will post to a table and post to an email address at the same time when the submit button is hit. I can only get it to do one or the other but not both. Any suggestions how to do both.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I can get the mail function to work but I want it to work only when the form is submitted and to have the form post to my table at the same time. Where do I put the mail code so that it works at the same time as posting to the table?
Where is the code for posting to the table?
Oh.
When you say "table" do you mean ...
<table>
or
INSERT INTO table(column [, ...]) VALUES(value [, ...])
?
I've assumed (possibly wrongly) you meant an SQL table rather than an HTML table.
Oh.
When you say "table" do you mean ...
<table>
or
INSERT INTO table(column [, ...]) VALUES(value [, ...])
?
I've assumed (possibly wrongly) you meant an SQL table rather than an HTML table.
ASKER
Yes, I meant MySQL table. I want the sumit button to send the data to my database and to send an email notifying that the database has been updated. Can anyone help? I don't know code.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What you need to look at is the mail() command in PHP.
http://docs.php.net/manual/en/function.mail.php
There first example ...
<?php
// The message
$message = "Line 1\nLine 2\nLine 3";
// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);
// Send
mail('caffinated@example.c
?>