This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2005 > Database insert and Email notification





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Database insert and Email notification
305Design

2005-08-31, 7:33 pm

I was wondering if I have built a form and inserting the form results as a
record into a mysql database how can get email notification that a new
user/order has been received?

Michael


Steve Grosz

2005-08-31, 7:33 pm

Guess it depends on the language you're using to insert info into the
database......can you say what that is?

Stev

305Design wrote:
> I was wondering if I have built a form and inserting the form results as a
> record into a mysql database how can get email notification that a new
> user/order has been received?
>
> Michael
>
>

305Design

2005-08-31, 7:33 pm

I am using the insert server behavior in DW - in php.

Michael

"Steve Grosz" <boise_bound@hotmail.com> wrote in message
news:df4hkh$6ob$1@forums.macromedia.com...[color=darkred]
> Guess it depends on the language you're using to insert info into the
> database......can you say what that is?
>
> Stev
>
> 305Design wrote:


305Design

2005-08-31, 7:33 pm

I found something, tweaked it and that works great - if anyone else needs it
Refined versions.

Enjoy!

//////////////////////////////////////////////////////////////////////////
//*** hack : Send email notification on RECORD INSERT EXECUTION ***//
// Insert just above the line that reads:
// "} // end function insert_record" in business_logic.php.
//////////////////////////////////////////////////////////////////////////

//*** Edit Below E-mail Information: ***//
$mailname = 'Server'; // who the mail is from.
$mailfrom = ''; // reply address (not needed)
$mailto = 'webmaster@SwahiliService.com'; // email address to send the
notification to.
//*** Do Not Edit Beyond This Point ***//

$subject = "$table_name: New Record Inserted"; // subject of email.
$message = "Please do not reply to this email. "; // message body.
$message .= "It has been generated automatically by the database
interface.\r\n";
$message .= "Query:\r\n------------\r\n";
$message .= "$sql\r\n";
$mail_head = "From: $mailname <>\r\nReply-to: $mailfrom\r\n";
$mail_head .= "MIME-Version: 1.0\r\n";
$mail_head .= "X-Mailer: PHP " . phpversion();
mail($mailto, $subject, $message, $mail_head);
//*** end hack : Send email ********************************************//
//////////////////////////////////////////////////////////////////////////



AND


//////////////////////////////////////////////////////////////////////////
//*** hack : Send email notification on RECORD UPDATE EXECUTION ***//
// Insert just above the line that reads:
// "} // end function update_record" - in business_logic.php.
//////////////////////////////////////////////////////////////////////////

//*** Edit Below E-mail Information: ***//
$mailname = 'Server'; // who the mail is from.
$mailfrom = ''; // reply address (not needed)
$mailto = 'webmaster@SwahiliService.com'; // email address to send the
notification to.
//*** Do Not Edit Beyond This Point ***//

$subject = "$table_name: Record updated"; // subject of email.
$message = "Please do not reply to this email. "; // message body.
$message .= "It has been generated automatically by the database
interface.\r\n";
$message .= "Query:\r\n------------\r\n";
$message .= "$sql\r\n";
$mail_head = "From: $mailname <>\r\nReply-to: $mailfrom\r\n";
$mail_head .= "MIME-Version: 1.0\r\n";
$mail_head .= "X-Mailer: PHP " . phpversion();
mail($mailto, $subject, $message, $mail_head);
//*** end hack : Send email ********************************************//
//////////////////////////////////////////////////////////////////////////




"305Design" <michael@305design.com> wrote in message
news:df4gj6$5gc$1@forums.macromedia.com...
>I was wondering if I have built a form and inserting the form results as a
>record into a mysql database how can get email notification that a new
>user/order has been received?
>
> Michael
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews