sulak Posted March 3, 2010 Share Posted March 3, 2010 Hello all, I am new here and also new to php but i have an issue and I would like some assistance please. So here it is: I have a site with a guest book but I am gettin a lot of spam since the guest book automatically post the comments. Guest book comments are also control from my admin backend (so i can edit, approve, delete from there) the guest book form starts like this: <form name="mygform" action="saveguest.php" method="post"> this means once the data is processed it is control by saveguest.php i would like stop the comments from being posted automatically and has to be approved from my admin area before they are visible on the front end. can someone pls tell me what to change in saveguest.php to avoid comment posting without appoval? I have attached the file for review. not sure if this is clear enough but as I mentioned before "I am new in this world" thanks in advance [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/194064-dont-know-php-but-i-need-help-please/ Share on other sites More sharing options...
Deoctor Posted March 4, 2010 Share Posted March 4, 2010 for this u can do one small change in the mysql database and create one column with default value of 0 for it to all the messages table in your database.. so when ever it is zero u dont display the comment in the site and when the admin approve it the value of the zero should change to 1 and then all it will do.. Link to comment https://forums.phpfreaks.com/topic/194064-dont-know-php-but-i-need-help-please/#findComment-1021332 Share on other sites More sharing options...
sulak Posted March 4, 2010 Author Share Posted March 4, 2010 Dont mean to be a novice here but could you be more specific with details? as I am not sure how to even get started. here is a pic of the db tables then control the messages... thanks again, great pics of india on ur blog for this u can do one small change in the mysql database and create one column with default value of 0 for it to all the messages table in your database.. so when ever it is zero u dont display the comment in the site and when the admin approve it the value of the zero should change to 1 and then all it will do.. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/194064-dont-know-php-but-i-need-help-please/#findComment-1021401 Share on other sites More sharing options...
Deoctor Posted March 4, 2010 Share Posted March 4, 2010 what for you are using the status field?? if it is free u make the default value for the filed to be 0.. this is what that u are supposed to do.. 1) when a new message/comment is entered. u need to enter that in the table and keep the status value as 0 or unpublished.. 2) when you approve this in the admin panel then if u like this u modify the status value to approved or 1 3) to make them visible in the front end just display those messages for which the status is approved or 1.. 4) if ur using the status for some other thing, then try creating a new field value for this and use it.. hope u have got it.. Link to comment https://forums.phpfreaks.com/topic/194064-dont-know-php-but-i-need-help-please/#findComment-1021407 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.