Page 1 of 1

Email alert for form

Posted: Mon Oct 08, 2007 3:48 pm
by Sculpture
Hello,

I am trying to get an alert for an entry to a database to go back to an email address.
<?php mail($to='name@emailaddress.com', $subject='Entry in Database', $body='There is an entry in the Query section of the databse.');?>
I do not know if I am tackling the problem from the right direction. The result is multipal emails and I suspect that the page is sending an email ever time someone looks at the page.

Thanks for any help.

Posted: Mon Oct 08, 2007 3:53 pm
by s.dot
Yes. That code will run every time the page is viewed.

Posted: Mon Oct 08, 2007 3:59 pm
by Sculpture
I thought so, Is there a solution?

Posted: Mon Oct 08, 2007 6:28 pm
by califdon
Obviously you have code to do the database insert, just put your mail() code in there.

Posted: Tue Oct 09, 2007 4:31 am
by Sculpture
Thanks guys, I've nutted it out and you were correct.