Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End protect comment

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38375

    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 :(

    #103985

    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)
  • The forum ‘Back End’ is closed to new topics and replies.