View Single Post
  #26  
Old 11-05-2013, 08:56 AM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 96,115
Tequila is on a distinguished road
Default

Again I'm going to bring up this Spam Blocker idea for the script...
Quote:
I was looking at another script (that I am trying to merge) and saw this:

PHP Code:
if (isset($_POST['submit']) && $_SERVER['REQUEST_METHOD'] == "POST") {
    
$exploits "/(content-type|bcc:|cc:|document.cookie|onclick|onload|javascript|alert)/i";
    
$profanity "/(beastial|bestial|blowjob|clit|cock|cum|cunilingus|cunillingus|cunnilingus|****|ejaculate|fag|felatio|fellatio|****|fuk|fuks|gangbang|gangbanged|gangbangs|hotsex|jism|jiz|kock|kondum|kum|kunilingus|orgasim|orgasims|orgasm|orgasms|phonesex|phuk|phuq|porn|pussies|*****|spunk|xxx)/i";
    
$spamwords "/(viagra|phentermine|tramadol|adipex|advai|alprazolam|ambien|ambian|amoxicillin|antivert|blackjack|backgammon|holdem|poker|carisoprodol|ciara|ciprofloxacin|debt|dating|porn)/i";
    
$bots "/(Indy|Blaiz|Java|libwww-perl|Python|OutfoxBot|User-Agent|PycURL|AlphaServer)/i";

    if (
preg_match($bots$_SERVER['HTTP_USER_AGENT'])) {
        exit(
"<p>Known spam bots are not allowed.</p>");
    }
    foreach (
$_POST as $key => $value) {
        
$value CleanUp($value);

        if (empty(
$_POST['name']) || empty($_POST['email']) || empty($_POST['url']) || empty($_POST['collecting']) ) {
            exit(
"<p>Name, e-mail, URL and collecting are required fields. Please go back and fill in the form properly.</p>");
        } elseif (
preg_match($exploits$value)) {
            exit(
"<p>Exploits/malicious scripting attributes aren't allowed.</p>");
        } elseif (
preg_match($profanity$value) || preg_match($spamwords$value)) {
            exit(
"<p>That kind of language is not allowed through our form.</p>");
        }

    } 
It's part of the register file on two scripts I'm looking at actually, and may be a good idea to add into our script for more security and to make it safer for younger users.

What do you think? Something to add in if we can figure it out?
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote