I have the following html code:
<div class=" modal" id="indexModal">
<span class="thing"></span>
<a href="#" class="closeMe" title="Inchide">închide</a>
<h2 class="title">Promoţia lunii februarie!</h2>
<div>
<h3>Beneficiaţi de promoţia sezonului.</h3>
<p>În luna Februarie, vă oferă posibilitatea de a achiziţioana, solarii profesionale şi hobby, sisteme de irigatii, folie şi accesorii cu o reducere de 10% aplicată la preţul de producator.</p>
<a href="http://www.domain.com/solarii/10/solarii-profesionale-latimi-6m-sau-8m" class="orangeButton">vedeţi oferta specială!</a>
</div>
</div>
and I want to insert it into database but it doesn't saves the full content. I tried using htmlentities() on insert, and html_entity_decode() when I want to display the html. But all I get is this:
<div class=" modal" id="indexModal">
<span class="thing"></span>
<a href="#" class="closeMe" title="Inchide">?nchide</a>
<
Can you explain me, how to safely insert some html in database without problems and how to display that html afterwards on a page? My table is utf8_general_ci charset.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…