Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/12/2013, 21:45
Avatar de Alexis88
Alexis88
Philosopher
 
Fecha de Ingreso: noviembre-2011
Ubicación: Tacna, Perú
Mensajes: 5.552
Antigüedad: 13 años, 4 meses
Puntos: 977
Respuesta: formulario php

Para solucionar lo del undefined index data, ponle un id a la caja:

Código HTML:
Ver original
  1. <input type = "text" name = "data" id = "data" />

Hay algunos navegadores que reconocen el id y no el name y viceversa. Para que siga saliendo el formulario, no coloques el else, déjalo así:

Código PHP:
Ver original
  1. <?php
  2. if (isset($_POST["data"])){
  3.     echo "<strong>He nascut el dia <strong>".$_POST['data'];
  4.     echo "<br>";
  5.     echo "<strong>El mes signe es </strong>".signe_zodiac($_POST['data']);
  6. }
  7. ?>
  8. <form name="exercici4" method="POST" action="">
  9.     Data de naixament:
  10.     <input type = "text" name = "data" id = "data" />
  11.     <input type = "submit" name = "enviar" />
  12.     <input type = "reset" name = "esborrar" />
  13. </form>

Saludos
__________________
«Juro por mi vida y mi amor por ella, que jamás viviré para el provecho de otro hombre, ni le pediré a otro hombre que viva para el mío».

Ayn Rand