How to make comments visible to spammers only?
I am coding a small blog script. I want to have a feature like:
When a guest visits my blog, he / she will post comments (he / she should not be registered membership), his / her comments will display / visible to him / her only. This makes him / her happy. Comments really goes to database and be in editors' review mode. By the time, no one cannot see those comments (except blog owner). After reviewing, the comments will display for visitors later. He / she haven't know he / she is only person who sees those comments. I hope that this feature will prevent spammers and make entries avoid garbage thing.
I think I will use session and visitor's IP to do this. But I don't know how to do that in details. Please help me some lines of code.
Any helps will be a appreciation. Thanks a lot!
There is no sure fire way to do this. You can do it by IP, but clients IPs change. You can also create a cookie and use that, but that can also change.
To do it by IP, insert the IP with the comment and only display unapproved comments when the stored IP matches the client's. To get the clients IP use $_SERVER['REMOTE_ADDR']
|All times are GMT. The time now is 09:08 AM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0