How to in PHP? If "THIS" content is submitted, die.

Discussion in 'PHP' started by studlee46, Apr 10, 2008.

  1. #1
    Hey guys,

    I'm working on this php mail script. Trying to combat spam.

    I know this is simple. But I'm having a tough time. How do I add a statement thats like...

    IF { "http://" is submitted in the comments input field } die.
    (basically, if anyone tries to submit anything with 'http://' don't process the form.

    ELSE { We're cool, do nothing and process the form }

    I'd really appreciate it guys. If it gets more complicated I wouldn't have a problem paying someone.

    Thanks!
     
    studlee46, Apr 10, 2008 IP
  2. c4st

    c4st Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <?php
    
    if(strpos($_POST['fieldName'], 'http://') !== false) die();
    
    ?>
    PHP:
     
    c4st, Apr 10, 2008 IP
  3. studlee46

    studlee46 Peon

    Messages:
    102
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank c4st. Ill give it a shot. I REALLY appreciate it if it works!
     
    studlee46, Apr 11, 2008 IP