How to stop spammers

Discussion in 'PHP' started by kalaid, Oct 17, 2007.

  1. #1
    Hi gay's,
    How to stop spammers using header injection with my PHP Scripts?
     
    kalaid, Oct 17, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Lol at gays.

    And can you be more specific? You mean via the mail() function?

    You can do something like.
    
    $email = preg_replace('/([\r\n]|b?cc|:)/i', null, $email);
    
    PHP:
     
    nico_swd, Oct 17, 2007 IP
  3. grikis

    grikis Banned

    Messages:
    333
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    htmlspecialchars
     
    grikis, Oct 17, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    ^ No.

    htmlspecialchars() will still allow new lines and bbc and cc.
     
    nico_swd, Oct 17, 2007 IP