|    
			
				04/04/2012, 11:51
			
			
			  | 
  |   |  |  |  Fecha de Ingreso: abril-2012 
						Mensajes: 8
					 Antigüedad: 13 años, 6 meses Puntos: 0 |  | 
  |  Respuesta: Guardar datos de ckeditor en mysql con Php  
  gracias triby otra vez, este es mi codigo y como digo al momento de guardar lo hace pero lo guarda como si estuviera encriptado en MD5 ademas me gustaria saber como puedo recuperar ese valor para editarlo luego
 
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>Cotizador</title>
 </style>
 </head>
 <script type="text/javascript">
 function Validar()
 {
 var nombre = document.formulario.nombre.value;
 if(nombre==""){
 alert("Debe escribir al menos un nombre para el cotizador...");
 return false;
 }
 }
 </script>
 <?php
 $link="";
 include_once("/Applications/MAMP/htdocs/mod_cotizador/clases.php");
 $conexion=new Clase_Conexionbd;
 $link=$conexion->Conectabd();
 session_start();
 function formRegistro(){
 ?>
 <form action="cotizador.php" name="formulario" method="post"  enctype="multipart/form-data" onSubmit="return Validar()">
 Nombre:
 <input type="text" name="nombre" size="20" maxlength="20" /><br />
 Precio:
 <input type="text" name="precio" size="7" maxlength="20" /><br />
 imagen:
 <input type="file" name="imagen"  /><br />
 Descripcion:
 <textarea name="descripcion" id="descripcion"></textarea>
 <?php
 include("ckeditor/ckeditor.php");
 $CKEditor = new CKEditor();
 $CKEditor->basePath = 'ckeditor/';
 $config['toolbar'] = "Full";
 /*$initialValue = mysql_query("SELECT descripcion FROM cotizador") or die ("Error en la consulta");*/
 $CKEditor->replace("descripcion");
 ?><br>
 <script type="text/javascript">
 CKEDITOR.config.width = 830
 </script>
 <input name="Reset" type="reset" value="Regresar" />
 <input type="submit" name="botEnviarImagen" value="Crear Cotizador" />
 </form>
 <?php
 }
 // verificamos si se han enviado ya las variables necesarias.
 if (isset($_POST["botEnviarImagen"])) {
 $nombre = $_POST["nombre"];
 $descripcion= $_POST["descripcion"];
 $precio = $_POST["precio"];
 $nameimagen = $_FILES['imagen']['name'];
 $tmpimagen = $_FILES['imagen']['tmp_name'];
 $extimagen = pathinfo($nameimagen);
 $ext = array("bmp","gif","jpg","png");
 $imagen = "imagenes/".md5($name . time()).'.'.$extimagen['extension'];
 
 
 if(is_uploaded_file($tmpimagen)){
 
 if(array_search($extimagen['extension'],$ext)){
 
 copy($tmpimagen, $imagen);
 echo '<img src="'.$imagen.'" /><br>';
 
 }
 
 else {
 $mensaje = "Solo se permiten imágenes con formato bmp, jpg, gif o png...";
 print "<script>alert('$mensaje')</script>";
 }
 
 }
 
 // Hay campos en blanco
 if ($nameimagen==NULL){
 $imagen=$nameimagen;
 }else{
 $imagen=$imagen;
 }
 $query = 'INSERT INTO cotizador (nombre, precio, imagen, descripcion)
 VALUES (\''.$nombre.'\',\''.$precio.'\',\''.$imagen.'\',\  ''.$descripcion.'\')';
 mysql_query($query) or die(mysql_error());
 $mensaje = "Datos Guardados...";
 print "<script>alert('$mensaje')</script>";
 
 }else{
 formRegistro();
 }
 ?>
 
 <body>
 </body>
 </html>
     |