I'm having this query;
$sql = "INSERT INTO statusups (pid, text) VALUES ('{$_SESSION['sess_id']}', '{$_POST['appendedInputButton']}')";
and I'm processing the variable $_POST['appendedInputButton']
like this;
$_POST['appendedInputButton'] = $purifier->purify($_POST['appendedInputButton']);
$_POST['appendedInputButton'] = strip_tags($_POST['appendedInputButton']);
$_POST['appendedInputButton'] = trim($_POST['appendedInputButton']);
Does this protect me from XSS and eventually SQL injections? I've looked into mysqli and prepared statements and it looks like it takes to much code to do a simple thing. If this protects me from SQL injections and XSS I would love to keep to this method or should I upgrade to mysqli?
The function $purifier->purify comes from the plugin HTMLpurifier