/    Sign up×
Community /Pin to ProfileBookmark

Dreamweaver – how to send email when someone enters data in my database?

Hi there,

I have created a database and connect my form with it throught Dreamweaver.

Now, I need to make a function that sends email each time that someone enters data into my database. Does anybody know, how can I do that in Dreamweaver?

Thanks.

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@KDLAAug 06.2009 — Put something like this after your database submission code: http://www.dreamweaverclub.com/dreamweaver-php-form.php
Copy linkTweet thisAlerts:
@arjetaauthorAug 10.2009 — Here is my code in the end of the form:

<tr valign="baseline">
<td nowrap="nowrap" align="left">&nbsp;</td>
<td><input name="Submit" type="submit" id="Submit" value="Submit" /></td>
</tr>

</table>

<input type="hidden" name="MM_insert" value="form1" />

</form>

Which code should I put here?
Copy linkTweet thisAlerts:
@metal_royAug 11.2009 — use the mail function of php.

something like this will do the trick:

mail('[email protected]', 'Subject', 'You have a new message');

But keep in mind that after the submition if the user clicks refresh on his browser, you will get a second mail and a second submition in the db. So it is highly recommended to use captcha or some ajax form.
Copy linkTweet thisAlerts:
@arjetaauthorAug 18.2009 — Thanks for your reply. I put the code after submit button (code) and tried in many places... and it didn't work. Also about the captcha or ajax form... Can you tell me any good tutorial??

I googled and I was lost and now feel tired of trying to fix this issue.

I will appreciate very much some help here.
Copy linkTweet thisAlerts:
@arjetaauthorAug 20.2009 — I also want to send all the details through notification email: name, surname, email address... etc...

How can I do this???
Copy linkTweet thisAlerts:
@arjetaauthorSep 30.2009 — I don't know where to put my code like this:

$name = $_POST['name'];

$email_address = $_
POST['email'];

$message = $_POST['message'];

/////////// Checking for Email Injection/////////

if ( ereg( "[rn]", $name ) || ereg( "[rn]", $email_address ) ) {

header('Location: first_page.html' );

}

///////first_page.html... is this like thanks.php page or applicationform.php


/////////// Making the Email Message/////////

$email_subject = "New Email From ABC Site";

$email_body = "Thanks for the submission";

/////////// Sending the Email using the mail() function/////////

$headers = "From: [email][email protected][/email]";

mail($email_address,$email_subject,$email_body,$headers);
×

Success!

Help @arjeta spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...