Php  
$title = preg_replace(  );(todo code에 example)<br />

Nodejs<br />
// > npm install santize-filename<br />
//var sanitize = require("sanitize-filename");<br />
//var filename = sanitize(UNSAFE_USER_INPUT);

mysqli_real_escape_string for MySQL queries, 
htmlspecialchars for embedding user input in HTML,