Form Security

    Date: 01/15/09 (PHP Community)    Keywords: php, security, web

    Anyone have any advice for form security? I've been trying to use the advice from this page, but it doesn't seem to be working... Specifically, what happens is I get the error page and then the email shows up anyways...

    if (ereg( "[\r\n\\r\\n]", $lastname ) || ereg( "[\r\n\\r\\n]", $email ) ||ereg( "[\r\n\\r\\n]", $firstname )||empty($email) || empty($firstname) ||empty($lastname) || empty($zipcode) ) {header( "Location: error.php" );}
    else {mail( "blah@blah.com", "Website Form Request",$message, "From: $email" );header( "Location: thankyou.php" );}

    I added the \\n and \\r because that was what was displaying when I'd test with a \n in the fields. This is my first time working with a form, so I'm sure I have a lot to learn...

    Source: http://community.livejournal.com/php/653858.html

« php driven image gallery -... || Working with multi arrays »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home