When users post a bulletin for others to see, if they use a single quote they get a sql error message saying near character ' and I imagine if regular quote it would do pretty much the same thing. Am I to somehow add slashes and later remove them?
What I am showing here we are supposively making the posted data safe.
Basically the make_safe function tries to check for certain tags to disallow.
$journal_text=make_safe($HTTP_POST_VARS["details"],TRUE);
$sql="insert into journal";
$sql.="(journal_of";
$sql.=", journal_date";
$sql.=", journal_time";
$sql.=", journal_text)";
$sql.=" values($journal_of";
$sql.=", '$date_posted'";
$sql.=", '$time_posted'";
$sql.=", '$journal_text')";
I imagine the single quotes aren't being escaped. Is there a more secure way to do this or am I on the right track?