Forums

Give help. Get help.

  • # June 6, 2012 at 8:46 am

    hi !
    I want to protect my comment box … I mean if any user can use the html codes in his comment … but i want to protect this box … if he use bad words … like get cookies or information of database or somthing like this … i wish if anybody have any function to do this work to help me.
    i’m sorry about my english, it’s not well :(

    # June 6, 2012 at 6:11 pm

    I understand you … I use the bbcode and this is my security function


    public function post($post,$type=false) {
    if(get_magic_quotes_gpc()){
    $post = stripslashes($post);
    }
    $post = mysql_real_escape_string($post);
    $post = trim($post);
    $post = ($type==false?strip_tags($post):htmlspecialchars($post));
    return $post;
    }

    in comment box i’m doing

    post($_POST,true);

    and on each other i’m doing

    post($_POST);

    this is true ?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag