For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > June 2004 > Re: sub or function to make html sql safe









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: sub or function to make html sql safe
Garp

2004-06-24, 6:26 pm


"dan" <dcasey@bestweb.net> wrote in message
news:pan.2004.06.03.07.45.12.446983@bestweb.net...
>
>
> Before I drive myself crazy doing this, I figured someone in here must
> have on. I am looking to see if anyone has written a sub or function that
> can take html, and parse it to make it sql friendly.
>
> What it must be able to do:
> if the original html to be parse is
> <a href="somefile">text with single ' or double " quotes in it</a>
>
> the function should change it to something like this:
> <a href='somefile'>text with single ‘ or double " quotes in
> it</a>
>
> Note: the double quotes in the <tag> where changed to single quotes, while
> the double quotes in the text were changed to ".
>
> hopefully i can do more, but as long as it can tell the difference between
> the quotes in a tag, and the quotes in text, thats .
>
> Thanks!


Nothing you can't do in thirty seconds with htmlspecialchars() and
substr_replace().

Garp


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com