Ok, here's the problem. I have an include file called parse.inc that I include at the top of my pages to have the functions available for escaping chars for database inserts and such. The file is shown below. When I include the file, PHP recognizes the function, but simply spits out the exact same thing that is passed to it. For example, isn't comes out isn't. Not good. Is this a setup issue with PHP by chance? Or did I screw something up in the str_replace stuff? Thanks ahead of time.
<?php
function form2db($s){
if($s == "") {
return " ";
}
return str_replace("\\","\",str_replace("\\"","\"",str_replace("\'","''",$s)));
}
function form2txt($s){
return str_replace("\\","\",str_replace("\\"","\"",str_replace("\'","'",$s)));
}
function db2form($s){
return htmlspecialchars($s);
}
function db2html($s){
return htmlspecialchars($s);
}
?>