$_GET
Publicado por ismael (15 intervenciones) el 15/03/2018 18:10:56
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
$var = $_GET['algo'];
echo '<form name="registroUsuarios" method="post" action="get.php">
<label>Introduce tu contraseña nueva</label>
<input type="text" size="60" name="algo"/><br>
<input type="submit" value="enviar">
<input type="reset" value="limpiar">';
if(isset($var)){
echo $var;
}
?>
Intento procesar esa variable $_GET desde el mismo formulario. Pero claro, si no esta declarada sale un notice
Notice: Undefined index: algo in C:\xampp\htdocs\pruebas\phps\get.php on line 6
y luego, claro, tampoco recoge la variable cuando envias submit y no se muestra ese echo.
Alguna idea de cómo hacer lo que pretendo?
Valora esta pregunta


0