Enth3 JavaScript Spam Protection

Open show_join.php and near the bottom, find this:
<input type="submit" value="Join the <?php echo $info['listingtype']; ?>"
class="enth3_submit" />

..just before it, add:
<script type="text/javascript">
<!--
document.write('<input type="hidden" name="spamproofing" id="spamproofing" value="SPAMWORD" />');
//-->
</script>
<noscript><div>JavaScript must be enabled to join due to spam restrictions in place.</div></noscript>

At the top of the file, after this:
if( isset( $_POST['join'] ) && $_POST['join'] == 'yes' ) {

..add this:
if (!isset($_POST['spamproofing']) || $_POST['spamproofing'] != "SPAMWORD") {
echo "<p>JavaScript must be enabled to join here due to spam restrictions in place.</p>";
exit;
}

Swap SPAMWORD for a word of your choice — make sure they are absolutely identical otherwise people won’t be able to join your fanlistings!

You can test your new spam proofing by turning off JavaScript and trying to join your own fanlisting/s.

Please note: this method of spam reduction is not completely foolproof. There is no way to 100% prevent spam. This method will only work against spam bots that do not understand JavaScript.

Speak Your Mind

*