hola, soy nuevo en esto pero he tenido problemas para realizar loss ejemplos de 2 videotutoriales, son formularios sencillos para empezar a explicar pero no me sale como en el video
lo ke hacen en el video un formulario con un solo campo de texto y un boton, el input se llama "dato" y llama a una pagina php pero esta al cargar no muestra nada y el tipo del video si.....
los mostrare el codigo
el html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<form method="get" action="practica.php" >
<input type="text" name="dato" />
<input type="submit" value="Ok!" />
</form>
</body>
</html>
el php
<?php
$horario = array(
'mañana' => array(
'deporte' => 'futbol',
'ocio' => 'videoconsola'
),
'tarde' => array(
'deporte' => 'baloncesto',
'ocio' => 'cine'
)
);
echo $horario["$dato"]['deporte'];
?>
el video es este
http://www.youtube.com/watch?v=Gj2P3fRwcbo&feature=PlayList&p=DAA51B79DD940E5A&index=12
anteriormente con este mismo formulario tuve ke agregar algo para ke mostrara una variable y fue $_REQUEST[]
y el codigo fue asi
<?php
$dato = $_REQUEST['dato'];
echo $dato;
?>
eso fue con el mismo formulario y solo asi me mostro el valor de dato pero no se como hacerlo asi
lo ke hacen en el video un formulario con un solo campo de texto y un boton, el input se llama "dato" y llama a una pagina php pero esta al cargar no muestra nada y el tipo del video si.....
los mostrare el codigo
el html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<form method="get" action="practica.php" >
<input type="text" name="dato" />
<input type="submit" value="Ok!" />
</form>
</body>
</html>
el php
<?php
$horario = array(
'mañana' => array(
'deporte' => 'futbol',
'ocio' => 'videoconsola'
),
'tarde' => array(
'deporte' => 'baloncesto',
'ocio' => 'cine'
)
);
echo $horario["$dato"]['deporte'];
?>
el video es este
http://www.youtube.com/watch?v=Gj2P3fRwcbo&feature=PlayList&p=DAA51B79DD940E5A&index=12
anteriormente con este mismo formulario tuve ke agregar algo para ke mostrara una variable y fue $_REQUEST[]
y el codigo fue asi
<?php
$dato = $_REQUEST['dato'];
echo $dato;
?>
eso fue con el mismo formulario y solo asi me mostro el valor de dato pero no se como hacerlo asi