Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/06/2012, 15:12
isaacr_22
 
Fecha de Ingreso: noviembre-2011
Mensajes: 24
Antigüedad: 12 años, 5 meses
Puntos: 0
tinymce no manda el texto formateado a la base de datos mysql

Hola compañeros nececito ayuda con este problema.

Tengo un web intente hacerle algunas mejoras pero ahora ya no me funciona el TINYMCE.

Envía el texto que se escribe en el textarea a la base de datos mysql pero llega normal, no me lo escribe formateado por ejemplo si hubiera usado negritas no sale.

Esto es lo que tengo:

El código php que hace la conexión

Código PHP:
Ver original
  1. <?
  2. include("includes/conexion.php");
  3. include("conecta.php");
  4.  
  5. //$link=Conectarse();
  6. if (array_key_exists('envia',$_POST))
  7. {
  8.    
  9.     $titulo=strip_tags(ucwords($_POST['titulo']));//duda, k funcion hece (utf8_decode(ucwords)
  10.     $descripcion=(ucwords($_POST['descripcion']));
  11.     $noticia=strip_tags($_POST['noticias']);
  12.     $seccion=$_POST['seccion'];
  13.     $usuario=$_SESSION['usuario'];
  14.     ///
  15.    
  16.     $carpeta="images";
  17.     $bytes='10000';
  18.  
  19. if (!file_exists($carpeta))
  20.     {
  21.        mkdir($carpeta);
  22.        @chmod($carpeta,0777);
  23.        
  24.     }
  25.    
  26. if ($_FILES['archivo'])
  27. {
  28.     if ((1000*$bytes)> $_FILES['archivo']['size'])
  29.     {
  30.         $cartmp=$_FILES['archivo']['tmp_name'];
  31.         $nombre=$_FILES['archivo']['name'];
  32.         $cambiar=$carpeta.'/'.$nombre;
  33.         move_uploaded_file($cartmp,$cambiar);
  34.        
  35.    }
  36. }
  37.        
  38.         $sql="insert into tbl_noticias (titulo,descripcion,contenido,fecha,visible,seccion) values ('$titulo','$noticia','$cambiar',NOW(),'0','$seccion')";
  39.         $rs=conectar($sql);
  40.    if ($rs)
  41.    {
  42.       ?>
  43.        <script language="javascript">
  44.         alert("Gracias por utilizar este espacio, tu publicacion será verificado por el adminsitrador, en breve se publicará tu noticia")
  45.        </script>
  46.      <?
  47.      print "<meta http-equiv=Refresh content=\"0; url=Noticias.php\">";
  48.    }
  49.  
  50.  
  51.  }
  52.  else
  53.  {
  54.  if ($_SESSION['activo'])
  55.  {
  56. ?>

Este es el escrip del TINYMCE

Código Javascript:
Ver original
  1. <script language="javascript" type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"> </script>
  2.    <script language="javascript" type="text/javascript">
  3.       tinyMCE.init({
  4.          mode : "textareas",
  5.          theme : "advanced"
  6.       });
  7.    </script>

Esta es la otra parte del formulario

Código HTML:
Ver original
  1. <h2>REGISTRO DE NOTICIAS:</h2>
  2.         <p class="lead">Introduzca informaci&oacute;n solicitada</p>
  3.            <form action="" method="post" enctype="multipart/form-data""" class="form" id="EnterForm"<?php echo $_SERVER['PHP_SELF'];?> autocomplete="off" accept-charset="UTF-8" >
  4.  
  5.           <div class="inpwrp">
  6.                 <label for="FirstName">Titulo</label><br>
  7.                 <input type="text" name="titulo" id="FirstName">
  8.         <br>
  9.                 <!--<p class="inputInfo">Put in your real name so your friends can find you.</p>-->
  10.             </div>
  11.  
  12.             <div class="inpwrp">
  13.                 <label for="LastName">Foto</label><br>
  14.                 <label for="descripcion"></label>
  15.                 <input type="file" name="archivo" id="descripcion">
  16.               <br>
  17.             </div>
  18.  
  19.             <div class="inpwrp">
  20.                 <label for="Signup_Username">Noticias</label><br>
  21.                 <textarea name="noticias" cols="50" id="area4"></textarea>
  22.             </div>
  23.  
  24.             <div class="inpwrp">
  25.                 <label for="Signup_Password">Seccion</label><br>
  26.                 <label for="seccion"></label>
  27.                 <select name="seccion" id="seccion">
  28.                   <?php notamenuop();?>
  29.                 </select>


Esta es la tabla que tengo en la base de datos

Código SQL:
Ver original
  1. -- Estructura de tabla para la tabla `tbl_noticias`
  2. --
  3.  
  4. CREATE TABLE `tbl_noticias` (
  5.   `id` INT(11) NOT NULL AUTO_INCREMENT,
  6.   `titulo` VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT '',
  7.   `descripcion` longtext NOT NULL,
  8.   `contenido` longtext CHARACTER SET utf8,
  9.   `fecha` DATE NOT NULL DEFAULT '0000-00-00',
  10.   `visible` tinyint(1) NOT NULL DEFAULT '0',
  11.   `seccion` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL,
  12.   `user` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL,
  13.   PRIMARY KEY (`id`)
  14. ) ENGINE=MyISAM  DEFAULT CHARSET=ascii AUTO_INCREMENT=165 ;


espero me puedan ayudar