Escaping characters is actually very complicated as each language handles it a little differently.
I wrote the AJAX to PHP and PHP to AJAX while my Database guru Mac wrote the PHP to MySQL and MySQL to PHP.
When you get the chance get back to me, I enjoy helping out when I can in the ways that I can.
You let me blog about my project with no reservations the least I can do is help you out with yours.
Speaking of which I have no clue what software you are using for yours, nordo I truly know your experience level
with web languages, if you are to it, fill me in via PM some time. I have a feeling I might be able to help you
tighten up your code.