Don't allow user to enter HTML tags in input

后端 未结 3 863
青春惊慌失措
青春惊慌失措 2021-01-22 04:11

I have an input which allows users to enter text, which is then sent using PHP to another page, where it is stored in a database. I have done some simple validation ( checking i

3条回答
  •  春和景丽
    2021-01-22 04:18

    To check try this:

    if( preg_match('#^<.>.+$#', $your_value) ){
        echo "NOT GOOD";  // and some error too
    }
    

提交回复
热议问题