Jump to content

Retrieving quotes stored in mysql

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Hignar

Hignar

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 420 posts
Hi Guys,

In need of a bit of help again. I'm trying to implement a system not to dissimilar to the posting screen on this forum (a simplified version anyway) and I want to allow the user to add a link to his posts. I've added a button that launches a javascript popup for him to enter the url which is added to the post in format along the lines of

[a href="http://www.google.co.uk"]Link Text[/a]

when the post is submitted to the database it's converted to html and is stored in mysql as

<a href=\"http://www.google.co.uk\">Link Text</a>

The quotes are escaped when submitted to the database but it seems that both the quotes and backslash already present are both escaped again when using echo. What I end up with in the final html is

<a href=\\\"http://www.google.co.uk\\\">Link Text</a>

I've tried using stripslashes when before echoing the link but it doesn't seem to have any effect.

The really frustrating thing is that I had it working a couple of days ago and I'm sure I've not changed anything :confused:

Any ideas how I can resolve this without changing what is stored in the database?
If there's a new way, I'll be the first in line.

But, it better work this time.

#2
Hignar

Hignar

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 420 posts
Sorry guys, false alarm. Stripslashes is doing the job fine. I'd just edited the wrong bit of the code. Time for bed I think if I'm making mistakes like this.
If there's a new way, I'll be the first in line.

But, it better work this time.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users