php - SQLi Protection From User Input Text -


this question has answer here:

i put manual sqli parameter checks in place (i.e check if input valid email).

although in case, need put user message db

how work?

i tried code, whole input gets erased somehow.

<?php  $text = "hello world";  echo "$text ";  $text = stripslashes($text); $text = mysqli_real_escape_string($text);  echo $text;  ?> 

thannk you!

need linking parameter mysqli like

$text = $db->mysqli_real_escape_string($text); 

example:

//escaping characters $db->real_escape_string('this unescaped "string"'); //there alias function can use shorter , less type:  $db->escape_string('this unescape "string"'); 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -