Código HTML:
<form action = "" method = "GET" class = "formulario"> <table align = "center"> <tr> <td> <input type = "text" name = "Matricula" placeholder = "Matricula Usuario" size = "35" maxlength = "35" > <input class = "button" type = "submit" name = "Accion" value = "Buscar" > <input class = "button" type = "reset" name = "Accion" value = "Borrar" > <input class = "button" type = "submit" name = "Accion" value = "Prestamo" > <input class = "button" type = "submit" name = "Accion" value = "Devolucion" > <input class = "button" type = "submit" name = "Accion" value = "Translado" > <input class = "button" type = "submit" name = "Accion" value = "Reportes" > <input class = "button" type = "submit" name = "Accion" value = "Agregar" > </td> </tr> </table> </form>
Código PHP:
<?php
if(isset($_GET['Accion']) && $_GET['Accion'] == 'Buscar')
{
$matricula = $_GET["Matricula"];
echo $matricula;
}
if(isset($_GET['Accion']) && $_GET['Accion'] == 'Prestamo')
{
$matricula = @$_GET["Matricula"];
echo $matricula;
?>
<blockquote>
<br>Ingrese los datos del Prestamo :<br>
<form name = "FormularioPrestamo" method = "POST" action = "" onsubmit = "return validarPrestamo()">
<p>Usuario :</p>
<input type = "text" value = "Aceptar" name = "Matricula" size = "35" maxlength = "35" placeholder = "Matricula Usuario">
<p>Equipo :</p>
<input type = "text" value = "Aceptar" name = "Codigo" size = "35" maxlength = "35" placeholder = "Codigo Equipo"/>
<input type = "submit" value = "Aceptar" class = "button" />
<input type = "submit" value = "Cancelar" class = "button" />
<br />
</form>
</blockquote>
<?php
}
if(isset($_GET['Accion']) && $_GET['Accion'] == 'Devolucion')
{
header('location: Devolucion.php');
}
if(isset($_GET['Accion']) && $_GET['Accion'] == 'Translado')
{
header('location: Translado.php');
}
if(isset($_GET['Accion']) && $_GET['Accion'] == 'Reportes')
{
header('location: Reportes.php');
}
if(isset($_GET['Accion']) && $_GET['Accion'] == 'Agregar')
{
header('location: Agregar.php');
}
?>