php - Escaping quotes before MySQL -


here have script validate description users pass:

if(strlen($_post['descriprtion']) >250) {     //some error code here } else {  $description = $mysqli->escape_string(htmlentities(trim($_post['description']))); } 

now, test description i'm testing. give me when print out page:

as can see, there's black slash before single quote.

i considering using stripslashes(), should use it?

use stripslashes() when want echo variable.

echo $var;                 // --> i\'m testing. not funny. echo stripslashes($var);   // --> i'm testing. not funny. 

working dmeo


Comments

Popular posts from this blog

node.js - StackOverflow API not returning JSON -

ios - Apple Push Notifications + TestFlight + Enterprise wildcard provisioning profile -

android - Drag and drop in ScrollView -