Hi,
From the code, there is an anomaly:
when you do:
$frm_headline = ereg_replace("'", "\'", $frm_headline);
it should NOT put in \ characters. This is because you are escaping directly in the code. I don't know if I'm being clear. But let me give you an example:
$text = "Don't eat the cherries";
$text = ereg_replace("'", "\'", $text);
After the above code, the value in $text is STILL:
"Don't eat the cherries";
BUT, if you do this:
$text = ereg_replace("'", "\'", $text);
then, the value in $text becomes:
"Don\'t eat the cherries";
If you can show more of your code here (and point out on which line you get the error and/or where it puts in the ), then I can help further.
Meanwhile, I suggest doing this: use str_replace instead of ereg_replace. The function takes the exact same arguments but it doesn't try to do any regular expressions. I don't know how this may help, but I've always used str_replace whenever I had to add in \ characters or remove them.
-sridhar