bunnyali2013 Posted November 21, 2012 Share Posted November 21, 2012 I want to know, how to make a report or flagging system for spam comments? Suppose I have a table which is displayed from my database. In the table there are 3 columns, the first for name, the second for comment and the third is a button where a people can click to report as spam. I want to know how I can get the notification in MySQL? I mean how to proceed or what ways I can do it? Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/ Share on other sites More sharing options...
trq Posted November 21, 2012 Share Posted November 21, 2012 Where exactly are you stuck? Do you know how to insert data into a database? Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394047 Share on other sites More sharing options...
bunnyali2013 Posted November 21, 2012 Author Share Posted November 21, 2012 Yes I know! I mean for example look at this forum, there is a "flag report" above on each post. I want the same but perhaps more direct. I mean a user will click on a button, and I will get a notification. I mean, how I should proceed this? I want ideas, I will try to make it myself! Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394048 Share on other sites More sharing options...
trq Posted November 21, 2012 Share Posted November 21, 2012 It's pretty straight forward. At it's simplest, a user clicks a report button, a record is added to the *reports* table that stores the id of the thing being reported. You then simply display a list of these reports wherever you like. Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394055 Share on other sites More sharing options...
bunnyali2013 Posted November 21, 2012 Author Share Posted November 21, 2012 So it ideals about the ID of each comment? Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394056 Share on other sites More sharing options...
trq Posted November 21, 2012 Share Posted November 21, 2012 I'm not sure I understand that comment. Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394058 Share on other sites More sharing options...
bunnyali2013 Posted November 21, 2012 Author Share Posted November 21, 2012 (edited) I think you have not understood the whole thing! Ok, I will try to explain it easily. I have a table in my database which record comments. The table has 4 columns (User, comments, date and flag). The table will be displayed on a web page except for the flag column not. The flag column will be empty in the database for each comment. On the web page now, at the right of each row, there is a flag button where people can click to report as spam. I mean the flag button is for each comment. I want to know, how to make something, where when a person has clicked on the flag button of a particular comment, I will get a notification in my database that this comment has been flagged by spam? When the person will flag the comment, a text like "Flagged" will be written in the row of the comment in the flag column in the database table. How to do that? Edited November 21, 2012 by bunnyali2013 Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394064 Share on other sites More sharing options...
trq Posted November 21, 2012 Share Posted November 21, 2012 When the user clicks the *flag* button, update the *flag* column in the database. Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394070 Share on other sites More sharing options...
bunnyali2013 Posted November 21, 2012 Author Share Posted November 21, 2012 Yes this is ok, but how to target the specific flagged comment in the database row? By its ID? Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394071 Share on other sites More sharing options...
trq Posted November 21, 2012 Share Posted November 21, 2012 Sorry, I'm really not sure where exactly you are stuck. The button the user clicks would need to submit a request to the server containing the id of the comment they wish to flag. A very simple example: comments.php some comment blah blab blah <a href="flag.php?id=22">flag as spam</a> flag.php <?php if (isset($_GET['id'])) { // execute your query } Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394074 Share on other sites More sharing options...
bunnyali2013 Posted November 21, 2012 Author Share Posted November 21, 2012 This is what I wanted LOL, about the ID.. thank you... I will implement all soon, if Ia find issues, I will post. Thank! Quote Link to comment https://forums.phpfreaks.com/topic/270979-report-or-flagging-system/#findComment-1394075 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.