Ver Mensaje Individual
  #3 (permalink)  
Antiguo 01/04/2011, 07:46
Narxon
 
Fecha de Ingreso: julio-2010
Ubicación: Galicia
Mensajes: 91
Antigüedad: 14 años, 8 meses
Puntos: 9
Respuesta: Duda con mi CMS

Por qué no le pones un nombre al submit y luego te ahorras todas las complicaciones con un simple if...
Código PHP:
Ver original
  1. <?php if(isset($_post["NombreDelSubmit"]))
  2. {
  3. //código para hacer el insert
  4. }
  5. else
  6. {
  7. <div class=post>
  8. <form action="post.php?enviar" method="post" enctype="multipart/form-data">
  9. <input type="hidden" name="story" value="<?php echo $_REQUEST['post'];?>">
  10. <input type="hidden" name="destination"
  11.        value="<?php echo $_SERVER['HTTP_REFERER'];?>">
  12. <table>
  13.  
  14. <tr>
  15.   <td>Titular<td>
  16. </tr>
  17. <tr>
  18.   <td><input size="80" name="headline"></td>
  19. </tr>
  20.  
  21. <tr>
  22.   <td>Titular<td>
  23. </tr>
  24. <tr>
  25.   <td><input size="80" name="post" value="<?php isset($_REQUEST['post']) ?>"></td>
  26. </tr>
  27.  
  28. <tr>
  29.   <td>Texto de la historia (puede contener etiquetas HTML)</td>
  30. </tr>
  31. <tr>
  32.   <td><textarea cols="80" rows="7" name="story_text"
  33.            wrap="virtual"></textarea>
  34.   </td>
  35. </tr>
  36.  
  37. <tr>
  38.   <td align="center"><input type="submit" value="Enviar"></td>
  39. </tr>
  40. </table>
  41. </form>
  42. </div>
  43. }
  44. ?>
__________________
Si algo te sirve de ayuda no dudes en dar Karma, a tí no te cuesta nada y a mi me haces feliz =D