replace deprecated mysql_escape_string function
Fix path and add secure function to printed var
Add prep title as name for the generated PDF file