Ver Mensaje Individual
  #4 (permalink)  
Antiguo 15/05/2012, 15:06
ferminako
 
Fecha de Ingreso: abril-2010
Mensajes: 298
Antigüedad: 14 años
Puntos: 1
Respuesta: TinyMCE devuelve valores corruptos???

Este es el form desde donde se envia:
Código PHP:
Ver original
  1. <FORM id='formAgregar' action='../Articulo_Agregar.php' method='post'>
  2.    <table>
  3.    <tr>
  4.    
  5.       <td>
  6.         <LABEL for='marca'>Marca: </LABEL>
  7.       </td>
  8.       <td>
  9.       <INPUT type='text' readonly='readonly' id='marca' name='marca' value='".$marca
  10.      
  11.      ."'>
  12.       <input type='hidden' name='marca' id='marca' value='".$marca."';
  13.       </td>
  14.     </tr>
  15.    <tr>
  16.    <td>
  17.     <LABEL for='familias'>Familia: </LABEL>
  18.     </td>
  19.      <td>
  20.     <input type='hidden' name='idMarca' id='idMarca' value='".$idMarca."'/>
  21.      <select id='SelFamilias' name='SelFamilias'>";
  22.    
  23.     for($i=0;$i<count($A_Familias);$i++)
  24.        {
  25.           echo "<option>".$A_Familias[$i]->getNombre()."</option>";
  26.        }
  27.        
  28.      echo "</select></td>";
  29.      
  30.  
  31.  
  32.   echo "</tr>
  33.  
  34.     <tr>
  35.    
  36.       <td>
  37.         <LABEL for='nombre'>Nombre: </LABEL>
  38.       </td>
  39.       <td>
  40.       <INPUT type='text' id='nombre' name='nombre'>
  41.       </td>
  42.     </tr>
  43.      <tr>
  44.       <td>
  45.         <LABEL for='descripcion'>Descripción: </LABEL>
  46.       </td>
  47.       <td>
  48.       <textarea id='descripcion' name='descripcion' rows='5' cols='46'>
  49.       </textarea>
  50.       </td>
  51.     </tr>
  52.      <tr>
  53.       <td>
  54.         <LABEL for='precio'>Precio: </LABEL>
  55.       </td>
  56.       <td>
  57.       <INPUT type='text' id='precio' name='precio'>
  58.       </td>
  59.     </tr>
  60.      <tr>
  61.       <td>
  62.         <LABEL for='nombre'>Foto: </LABEL>
  63.        
  64.       </td>
  65.       <td><input type='file' id='image'  name='image' onChange=LimitAttach(this.value);></td>
  66.  
  67.       <td>
  68.        
  69.       </td>
  70.  
  71.        <td>
  72.         <INPUT type='submit' value='Añadir' >
  73.  
  74.       </td>    
  75.     </tr>
  76.    </table>
  77.  </FORM>

Y este el php dnd lo envia:
Código PHP:
Ver original
  1. <?php
  2.     require("../../../php/config.php");
  3.     require("../../../php/Clases/GestionArticulos.php");
  4.     require("../Clases/ModifiedImage.php");
  5.  
  6.     echo $_POST['descripcion'];
  7.     $objGA= new GestionArticulos();
  8.     $cnA=mysqli_connect($GLOBALS["db_hostname"], $GLOBALS["db_user"], $GLOBALS["db_password"],$GLOBALS["db_name"] );
  9.    
  10.  
  11. if(!empty($_FILES['image']) && $_FILES['image']['error'] == UPLOAD_ERR_OK)
  12. {
  13.  
  14.  
  15.    $image = new ModifiedImage($_FILES['image']['tmp_name']);
  16.    $img = 'img_' . $_FILES['image']['name'];
  17.    $image->resizeToFit(200, 200, true, 'ffffff');
  18.    $image->save($img);
  19. }
  20.  
  21.     $resF=$objGA->InsertarArticulo($cnA,$_POST['nombre'],$_POST['descripcion'],
  22.     $_POST['precio'],$_POST['SelFamilias'],$_POST['idMarca'],$_POST['image']);