Email alert for form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Sculpture
Forum Commoner
Posts: 41
Joined: Sat Jun 11, 2005 6:57 pm
Location: Australia
Contact:

Email alert for form

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Yes. That code will run every time the page is viewed.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Sculpture
Forum Commoner
Posts: 41
Joined: Sat Jun 11, 2005 6:57 pm
Location: Australia
Contact:

Post by Sculpture »

I thought so, Is there a solution?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

Obviously you have code to do the database insert, just put your mail() code in there.
User avatar
Sculpture
Forum Commoner
Posts: 41
Joined: Sat Jun 11, 2005 6:57 pm
Location: Australia
Contact:

Post by Sculpture »

Thanks guys, I've nutted it out and you were correct.
Post Reply