hello guys how are you today i am not good with function so i want to ask a question how can i do that by function i have tried but i am Failure also how can i protect the input by this way by using mysql_real_esacpe,strip_tags ....

$getidtopic=$_GET['id_topic'];
    function isint (){
    global $getidtopic;
    if (!is_int($getidtopic)){
    return true;
    }else if (is_int($getidtopic)) {
    return false;
    }
    }
Member Avatar
diafol

I'm assuming that you're using vanilla mysql. Change to mysqli or PDO for binding parameters, then you don't have to worry out escaping input. However you may want to validate input, which is a different matter. Have a look here for built-in validate filters: http://php.net/manual/en/filter.filters.validate.php