Removing quotes and slashes from POST data

    Date: 10/26/05 (PHP Community)    Keywords: no keywords

    String = Don't tread on "me!"



    $account['MESSAGE'] = stripslashes($_POST['MESSAGE']);
    $search = array("\"","\'");
    $replace = array("", "");
    $account['MESSAGE'] = str_replace($search, $replace, $account['MESSAGE']);



    Result = Don't tread on me!

    ***
    How come this isn't catching the single quote?


    Just changed the replace method - thanks:

    $account['MESSAGE'] = str_replace('"',"",$account['MESSAGE']);
    $account['MESSAGE'] = str_replace("'","",$account['MESSAGE']);

    Source: http://www.livejournal.com/community/php/358460.html

« showing "include" files || Hey guys, first post »


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