Page 1 of 1
Post to Databast and Send mail in one action
Posted: Fri Nov 15, 2002 9:45 am
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
Posted: Fri Nov 15, 2002 10:00 am
by BDKR
In one action, as in statement, or in one script?
Cheers,
BDKR
Re. post to database and send mail
Posted: Fri Nov 15, 2002 10:10 am
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
Posted: Fri Nov 15, 2002 2:11 pm
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
Posted: Fri Nov 15, 2002 2:21 pm
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);