开发者

\ being added when uploading a link to db via form

Hope you can help me with this. On one of the fields in my add product page, I have the advertisers link to his product. It basically is a link and a button direct the customer to that link.

This 开发者_运维百科is what I uploaded in the field:

<a target='_blank' href='http://click.linksynergy.com/fs-bin/click?id=3qM*AG8K6Qo&offerid=146141.3706263&type=2&subid=0'><img border="0" src='style/buynowbutton.png' width='138' height='20'><a/>

and this is what ends up in the db:

<a target=\'_blank\' href=\'http://click.linksynergy.com/fs-bin/click?id=3qM*AG8K6Qo&offerid=146141.3706263&type=2&subid=0\'><img border=\"0\" src=\'style/buynowbutton.png\' width=\'138\' height=\'20\'><a/>

How can I stop this from happening?

Any help would be greatly appreciated


Because this strings automatically escaped
Read here, how you can improve your work with DB.

Use stripslashes and htmlspecialchars when output:

print htmlspecialchars(stripslashes($text));
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜