I found a post on DigitalPoint forums posted by GTech

I saw these, before I took my directory paid. Nothing stops a spammer so cold in their tracks as seeing a price to submit a link Though I must admit, a few have tried to sneak a free link in, even after I went paid. Takes all kinds, I guess.

If you are using PHPLD, you can open your submit.php file and at the very top, add the following:


* @link http://www.phplinkdirectory.com/
* @copyright 2004-2006 NetCreated, Inc. (http://www.netcreated.com/)
* @package PHPLinkDirectory
* @version 3.0.x
*
*/

//spammers list
if ($_REQUEST['OWNER_EMAIL'] == 'peqer@pntq.com') {exit;}
if ($_REQUEST['OWNER_EMAIL'] == 'qutq@oqtonliqe.net') {exit;}
if ($_REQUEST['OWNER_EMAIL'] == 'weqmaqter@scqqtaqart.com') {exit;}
if ($_REQUEST['OWNER_EMAIL'] == 'weqmaqter_qqeer@yahoo.com') {exit;}
if (strpos($_REQUEST['OWNER_EMAIL'], 'jqqlnqah.com')) {exit;}
//add more here as needed
$ip_address = GetEnv('REMOTE_ADDR');
if (strpos($ip_address, '125.23.60.') === true) {exit;}
if (strpos($ip_address, '125.23.49.') === true) {exit;}
if (strpos($ip_address, '203.134.198.') === true) {exit;}
if (strpos($ip_address, '203.91.133.') === true) {exit;}
if (strpos($ip_address, '203.134.203.') === true) {exit;}
if (strpos($ip_address, '59.93.204.') === true) {exit;}
if (strpos($ip_address, '59.94.245.') === true) {exit;}
if (strpos($ip_address, '209.128.236.') === true) {exit;}
//add more here as needed

Added some ‘q’s to the email addy’s above.

Basically, just replace the email addresses in the code with one’s you get from spammers. Replace a partial IP address above with a partial from your spammers. When you get a new spam email address, just copy/paste a line, change the email address, upload your submit page and you can stop them cold.

What this does is, before the submit.php page is processed, the code above checks your spammer list by email and IP. If a bad IP or email is found, then it exits the script all together. Meaning the submission isn’t even added to the database.

Now while this is a great way to stop directory spammers let’s take it a few steps further, and apply it to any directory that is coded in php.

Now lets examine the first command:

if ($_REQUEST['OWNER_EMAIL'] == 'user@email.com') {exit;}

This line is specific to phplinkdirectory. The reason being is because it checks the field “OWNER_EMAIL” when the form is submitted.

Now if you run another type of script it’s simple to change. Just navigate to your submission page and view the html source. Find in that page the name for the field where you enter your email address. *Hint search for email.

Once you found it swap it for OWNER_EMAIL and your done!

Now onto the second type of command.

if (strpos($_REQUEST['OWNER_EMAIL'], 'domain.com')) {exit;}

What this does is check the email field for domain.com and denies it if found.

The next segment requires the submitter’s ip address to be stored in a variable.

$ip_address = GetEnv('REMOTE_ADDR');

Once it’s stored you can now stop submissions with the following code.

if (strpos($ip_address, '00.00.00.') === true) {exit;}

If you’ll notice the ip address doesn’t contain the last set of numbers. This is because while banning the specific ip address would work, once the spammer got a new ip address you would have to repeat the whole process again.

Something to say?

You must be logged in to post a comment.

bigleague
bigleague