开发者

Semicolon In String in PHP

I am retrieving an html document from a MySQL db through PHP, and it has semicolons in the style tags like this

style="background-color:black;display:block"

I've had issues with the quotes, and esc开发者_开发技巧aped them with slashes however I can't do the same with a semi-colon. Is there any way to escape this?


I apologize everyone i didn't realize that escaping a semicolon is fundamental to sql injection, I'll explore alternatives.

Here's what I did, I did a str replace of ";" and replaced it with "\" style=\"" so that instead of stringing the attributes together in one style tag it put them in individual style attributes. When Firefox interpreted it, it combined them into one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜