Foros del Web » Programando para Internet » PHP »

Ayuda con formulario

Estas en el tema de Ayuda con formulario en el foro de PHP en Foros del Web. Hola amigos. La verdad es que yo no se de PHP pero necesito hacer algo y es pero que me puedan ayudar. tengo el siguiente ...
  #1 (permalink)  
Antiguo 15/09/2010, 09:31
 
Fecha de Ingreso: octubre-2009
Mensajes: 10
Antigüedad: 14 años, 6 meses
Puntos: 0
Ayuda con formulario

Hola amigos.
La verdad es que yo no se de PHP pero necesito hacer algo y es pero que me puedan ayudar. tengo el siguiente php
Código PHP:
function isJewishLeapYear($year) {
  if (
$year 19 == || $year 19 == || $year 19 == ||
      
$year 19 == || $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(5211993);
$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 valores de

Código PHP:
$jdNumber gregoriantojd(5211993); 
los tome de un formulario..... como puedo hacer eso?
  #2 (permalink)  
Antiguo 15/09/2010, 09:34
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Ayuda con formulario

te invito a leer lo siguiente:
http://www.php.net/variables.external
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #3 (permalink)  
Antiguo 15/09/2010, 10:08
Avatar de vertigo112  
Fecha de Ingreso: agosto-2006
Ubicación: Estado de Mexico
Mensajes: 25
Antigüedad: 17 años, 8 meses
Puntos: 1
Respuesta: Ayuda con formulario

Saludos amigo pues creo que practicamente lo que necesitas no es nada ya lo tienes todo ahi solo un formulario en HTML envia los datos y listo ya en tu PHP los recoges por el metodo POST asi:

formulario.html

Código HTML:
<!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>Formulario</title>
<link rel="stylesheet" type="text/css" href="estilos.css" />
</head>
<body>
<form name="formulario" action="acciones.php" class="form" method="POST">
<p>Valor1: <input type="text" name="valor1" /></p>
<p>Valor2: <input type="text" name="valor2" /></p>
<p>Valor3: <input type="text" name="valor3" /></p>
<p class="btn"><input type="submit" name="Enviar" value="Enviar" class="btn" /></p>
</form>
</body>
</html> 


tu archivo que ya tienes .php solo modificado ligeramente asi:

acciones.php

Código PHP:
<?
function isJewishLeapYear($year) {
  if (
$year &#37; 19 == 0 || $year % 19 == 3 || $year % 19 == 6 ||
      
$year 19 == || $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($_REQUEST['valor1'], $_REQUEST['valor2'], $_REQUEST['valor3']);
$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"
?>


el Extra del estilo del Fiormulario

estilos.css

Código HTML:
	body{
		font-family: Verdana;
		font-size: 12px;
	}
	.form{
		border: 1px dotted #E0E4E9;
		background: #F2F5F7;
		width: 300px;
		margin: 0 auto;
		padding: 10px;
	}
	input{
		width: 200px;
		padding: 8px;
		border: 1px solid #DCE1E4;
		background: #EDF0F1;
	}
	input.btn{
		border: 1px solid #D8D8D8;
		width: 80px;
		background: #FFFFFF;
	}
	p.btn{
		text-align: right;
		padding-right: 30px;
	}



un saludos desde Mexico

Última edición por GatorV; 15/09/2010 a las 10:21
  #4 (permalink)  
Antiguo 15/09/2010, 13:58
 
Fecha de Ingreso: octubre-2009
Mensajes: 10
Antigüedad: 14 años, 6 meses
Puntos: 0
Respuesta: Ayuda con formulario

Muchas gracias vertigo112, lo aplique y funciona al pelo

TKS!!!!

Etiquetas: formulario
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:36.