My friend is writing a simple forum,
In this forum there is 1 MySQL database with 4 tables(forumsections, members, posts, replies)
The question:
He wants to notify by mail those members who have posted new posts, when anybody replies to their post. (like in this forum). Now he has a checkbox in the post form(when posting a new post member has choice to have notifications by mail, if he checks the checkbox notifications will be sent him by mail otherwise not(by default checkbox is checked)). How to code this idea in PHP.
Thanks in advance

My friend is writing a simple forum,
In this forum there is 1 MySQL database with 4 tables(forumsections, members, posts, replies)
The question:
He wants to notify by mail those members who have posted new posts, when anybody replies to their post. (like in this forum). Now he has a checkbox in the post form(when posting a new post member has choice to have notifications by mail, if he checks the checkbox notifications will be sent him by mail otherwise not(by default checkbox is checked)). How to code this idea in PHP.
Thanks in advance

Whenver some post get the reply execute this code.This will give you all the members who have chosen to get informed by email when some post gets the reply
new_post_mail is the column field in the members table , set to 1 if the member checks the checkbox, else 0

$query = "select member_id,member_email_id from members where new_post_mail = '1'";

and mail using to this member_email_id. Put the link of that post in the mail

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.