TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-09-2009, 05:52 PM   #1 (permalink)
The Wanderer
 
superthin's Avatar
 
Join Date: Aug 2008
Posts: 16
Thanks: 7
superthin is on a distinguished road
Default How to make comments visible to spammers only?

Hello everybody,

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!

SuperThin.
__________________
http://khoancatbetong.com - Vietnamese Concrete Technician Forum
superthin is offline  
Reply With Quote
Old 10-11-2009, 01:18 AM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

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']
__________________

Village Idiot is offline  
Reply With Quote
The Following User Says Thank You to Village Idiot For This Useful Post:
superthin (10-11-2009)
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start comments in PHP: /* or /** Dave Absolute Beginners 15 03-30-2013 07:55 AM
Wordpress AJAX Comments Spy Haris Script Giveaway 9 03-30-2013 07:54 AM
Tips to Improve Your Coding and Projects Village Idiot Tips & Tricks 45 12-03-2012 07:46 AM
Make Your Own PHP Flash Player Which You Can Pass a File Variable with Preview!!!! thegrayman Tips & Tricks 2 12-12-2007 12:44 AM
Database Structure - Comments? Andrew MySQL & Databases 7 10-31-2007 12:54 AM


All times are GMT. The time now is 10:05 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design