You are here: Re: href in mysql databse « PHP SQL « IT news, forums, messages
Re: href in mysql databse

Posted by Paul Lautman on 08/22/07 17:59

J.O. Aho wrote:
> mbarbs wrote:
>> On Aug 22, 9:21 am, "J.O. Aho" <u...@example.net> wrote:
>
>>>> The problem is i have this for example <a
>>>> href="link.html">Link</a> in one of the fields in the mysql
>>>> database. When the page loads it shows the html <a
>>>> href="link.html">Link</a> NOT a clickable link.
>>> The problem is how you store the value to the database, you most
>>> likely used htmlentities() or a simialr function on the string
>>> before you stored it, which makes it to be displayed as it's
>>> written and not parsed by the browser as html-code.
>
>> How would you recommend the best way to do this?
>>
>
> If you use a form to input the data, you may need to use
> html_entity_decode() to get rid of all htm encoded characters (you
> don't want those)
>
> Before you store data into the database, you want to run
> addslashes(), this prevents problems with " or ' in the strings.
>
> And when you fetched the data from the database, use stripslashes(),
> before you echo things out.

Forget the stripslashes!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация