Post to Databast and Send mail in one action

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
tbergquist
Forum Newbie
Posts: 2
Joined: Fri Nov 15, 2002 9:45 am
Location: Oklahoma

Post to Databast and Send mail in one action

Post by tbergquist »

I am trying to find out how to post a form (from user input) to our MYSQL databast and in the same action, send an email notification that someone has posted data to the data base. I am new to PHP so I am not sure how to do this. Any ideas?
Thanks for your help!
tbergquist@okwu.edu
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

In one action, as in statement, or in one script?

Cheers,
BDKR
tbergquist
Forum Newbie
Posts: 2
Joined: Fri Nov 15, 2002 9:45 am
Location: Oklahoma

Re. post to database and send mail

Post by tbergquist »

Well, I guess I am not sure. I have been using Adobe GoLive to create our pages. I am sure you might think i am retarded or somthing...
My best educated guess would be in one script.

Thanks for your help
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Well, you can do it in one script. That's really no problem. You just need the mail() function and whatever process you choose to dump the data into a database. There are a number of good tutorials on dealing with the above issues.

Ultimately, nothing is better than learning how. Whatever this GoLive is, it's not as good as you are if you learn how to program.

Do a search on google for tutorails. PHPBuilder has a good share of tut's as well. The manual (at php.net) is a winner too. Stick around here too. Nobody will write a script for you (unless you pay them) but we will try to help.

Cheers,
BDKR
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

AFter your page inputs to the database you can do the following.

$recipient = recips_email;
$subject = "Your subject";
$message = "Hello $user. Glad you registered with us.";
$extra = "From: me@me.com";
mail ($recipient,$subject,$message,$extra);
Post Reply