Having a little problem here. I'm creating a way for users to write a blog and the system to show any blogs added to the database. This bit is all working fine except when a user is writing a blog I have given them two buttons: Add Image
and Add Link
. Now when clicked JavaScript kicks in and prompts the user for a URL and in the case of the link the link text as well. This all appears fine in the textarea when typing, however when inserting this into the database the single or double quotes obtain a backslash in front of them turning this: <a href='http://www.google.co.uk/'>Google</a>
into this <a href=\'http://www.google.co.uk/\'>Google</a>
. As you can imagine it then search the current directory for \'http://www.google.co.uk/\'
.
I am pretty sure I need to add a second backslash, but I'm unsure on how I would scan the entire message and add a backslash to each and every single or double quote depending on which I use?
Thanks in advance guys!