PHP - Ayuda con formulario

 
Vista:

Ayuda con formulario

Publicado por Kadhessim (2 intervenciones) el 15/09/2010 17:52:50
Hola amigos, la verdad no se de PHP pero tengo ke hacer algo

tengo este codigo

function isJewishLeapYear($year) {
if ($year % 19 == 0 || $year % 19 == 3 || $year % 19 == 6 ||
$year % 19 == 8 || $year % 19 == 11 || $year % 19 == 14 ||
$year % 19 == 17)
return true;
else
return false;
}

function getJewishMonthName($jewishMonth, $jewishYear) {
$jewishMonthNamesLeap = array("Tishri", "Heshvan", "Kislev", "Tevet",
"Shevat", "Adar I", "Adar II", "Nisan",
"Iyar", "Sivan", "Tammuz", "Av", "Elul");
$jewishMonthNamesNonLeap = array("Tishri", "Heshvan", "Kislev", "Tevet",
"Shevat", "Adar", "", "Nisan",
"Iyar", "Sivan", "Tammuz", "Av", "Elul");
if (isJewishLeapYear($jewishYear))
return $jewishMonthNamesLeap[$jewishMonth-1];
else
return $jewishMonthNamesNonLeap[$jewishMonth-1];
}

$jdNumber = gregoriantojd(5, 21, 1993);
$jewishDate = jdtojewish($jdNumber);
list($jewishMonth, $jewishDay, $jewishYear) = split('/', $jewishDate);
$jewishMonthName = getJewishMonthName($jewishMonth, $jewishYear);
echo "<p>The 21 May 1993 is the $jewishDay $jewishMonthName $jewishYear</p>\n";


pero necesito que los datos $jdNumber = gregoriantojd(5, 21, 1993); sean tomados de un formulario..... como se haría eso?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Ayuda con formulario

Publicado por Gerardo Esquivel (22 intervenciones) el 17/09/2010 19:03:21
Si te refieres a los datos de la fecha, estos puedes capturarlos de elementos input type="text" que se encontrarán en un form cuyo method será post o get (post es lo recomendable en esta ocasión) y que direccione al arhivo donde ejecutarás tus funciones.

Ejemplo:

archivo: capturafecha.html o capturafecha.php
<html>

<body>
<form action="procesafecha.php" method="post"
<input type="text" name="dia" />
<input type="submit" name="submit" value="Enviar" />
</form>
</body>
</html>

Si tengo algún error en las sentencias mil disculpas, ya ven que uno se acostumbra a utilizar el intellisense, ok.

Entonces en procesafecha.php cacharas estas variables de una variable tipo array que se llama $_POST de esta forma:

$dia = $_POST["dia"];

y listo, así con lo demás.

Saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Ayuda con formulario

Publicado por Kadhessim (2 intervenciones) el 17/09/2010 19:07:44
Gracias Gerardo, me ha servido bien tu ayuda
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar