How to save data in database and sent email
Hi friends I have in my website a contact form and I want to add to the user in an email and data saved in my database how to do please and thanks in advance
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kumar RavishankarRank #5,917 · 282 reputationPosted Aug 12, 2017, 7:24 AM EDT
ma oumlRank #3,005 · 479 reputationPosted Aug 12, 2017, 7:30 AM EDT
Manikandan MurugesanRank #300 · 8.4K reputationPosted Aug 12, 2017, 7:05 PM EDT
To send email, you can use the basic mail() php function.
First, define the headers:
Finally, you specify the recipient:
Wrap it up to mail function like that:
And you are done with the mail!
More about mail function you can find here.
As for updating the mysql, you can do this:
First make sure how you are going to identify the table. This can be done for example by the row id:
Then run the query:
mysql_query=("UPDATE other_tbl_name SET fco_name = '$name', fco_mobile = '$mobile', fco_email = '$email', fco_text = '$message' WHERE id = '$id'"); //here we used the row's id to specify which row to updateHope this was what you were looking for...
Gokhul VarmanRank #1,505 · 1.1K reputationPosted Aug 13, 2017, 5:42 AM EDT