Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/03/2015, 11:34
wilsonlazo
 
Fecha de Ingreso: julio-2013
Mensajes: 60
Antigüedad: 10 años, 10 meses
Puntos: 0
guardar html en base de datos

Hola gente quiero guardar el contenido de un editor de texto (ckeditor)

ejemplo:texto que genero:
Código HTML:
Ver original
  1. <p><strong>QUIENES SOMOS</strong></p>
  2.  
  3. <p><span style="font-family:courier new,courier,monospace"><span style="color:rgb(0, 0, 0); font-size:14px">More information about using this function without upgrading your version of PHP can be found on the below link:</span></span></p>
  4.  
  5. <p><span style="font-family:comic sans ms,cursive">DONDE ESTAMOS</span></p>
  6.  
  7. <p><span style="font-family:verdana,arial,helvetica,georgia,sans-serif; font-size:12px">Aunque ya casi no se usa, en los primeros momentos era un recurso de contacto en las p&aacute;ginas webs muy usado. Si a&uacute;n te gustar&iacute;a usarlo, aqu&iacute; especif&iacute;co TODA la sintaxis permitida y algunos ejemplo.</span></p>
  8.  
  9. <p>&nbsp;</p>

para guardar utilizo php :
Código PHP:
Ver original
  1. $html=htmlentities($this->input->post('html'));
  2.        // tambien intente con
  3. $b = html_entity_decode($this->input->post('html'));
  4.  
  5.  
  6. //para recuperara de la bd y mostrar
  7.  html_entity_decode($page['html']);

en mongodb se guarda asi:
Código PHP:
Ver original
  1. <p>NUESTRAS TIENDAS</p>\r\n\r\n<p>todd az</p>\r\n\r\n<p><span  new,courier,monospace">Try to use these on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.</span></p>

el problema es no me decodefica el style del elemento.
alguna otra forma de guardar valores generado por un editor. espero sus comentarios y saludos.