Mail Form in PHP

Discussion in 'PHP' started by seobit, Feb 20, 2010.

  1. #1
    How to make a secure mail form in php?
     
    seobit, Feb 20, 2010 IP
  2. markzero

    markzero Peon

    Messages:
    133
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    markzero, Feb 20, 2010 IP
  3. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you want to make it more secure you should pass the variables through these functions to make it safer:

    //input: $varname
    //strip html tags
    $_2ndvarname = strip_tags($varname);
    //strip slashes
    $finalvarname = stripslashes($_2ndvarname);
    //safe output: $finalvarname
     
    Imozeb, Feb 20, 2010 IP
  4. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #4
    function clean($input){
    return str_replace(array("content-type", "bcc:", "to:", "cc:", "href"), "", strip_tags($input));
    }
    PHP:
     
    danx10, Feb 20, 2010 IP