lunes, 4 de junio de 2018

CODIGO DE PAGINA WEB

<!DOCTYPE html>
<head>
<title> Altas </title>
<link rel="stylesheet" type="text/css" href="css/altas.css">
<style type="text/css">
    label {
    display: block;
    }

    </style>

<script type="text/javascript">


function hola(){
var valor=document.getElementById("numero").value;
alert(valor);

}

</script>
</head>
<body>

<!--<div id="tabla">-->
<form method="POST" action="aa.php">
<fieldset>
<legend>  ALTAS (REGISTROS) </legend>

<!--es para un panel -->
   <label for="nombre">Nombre</label>
<input type="text" name="nombre">
<!--el id para javascript name para php -->
<!--funciona con firefox-->
<label for="ApePat">Apellido Paterno</label>
<input type="text" name="apepat" >

<label for="ApeMat">Apellido Materno</label>
<input type="text" name="apemat" >


<label for="Sexo">Sexo masculino</label>
<input type="radio" checked="checked" name="sexo" value="M">
<label for="Sexo">Sexo femenino</label>
<input type="radio" name="sexo" value="F">



<label for="Edad">Edad</label>
<input type="number" name="edad">


<label for="Domicilio">Domicilio</label>
<input type="text"  name="domicilio">

<!-- funciona solo con el chrom-->
<label for="fecha">Fecha</label>
<input type="date" name="fecha">

<label for="usuario">usuario</label>
<input type="text" name="usuario">

<label for="pswd">pswd</label>
<input type="text" name="pswd">

       <br></btr>
<input type="submit" name="enviar" value="registrar">
<input type="submit" name="enviar" value="cancelar">

</form><!--es para mandar a llamar como un jooptionpane como-->
</fieldset>
<a href='index.php'>regresar</a>
<!--</div>-->
</body>
</html>
<?php
session_start();
include "conexion.php";
?>
</!DOCTYPE html>
<html lange="en">
<head>
<meta charset="utf-8">
<title> Documentos</title>
<link rel="stylesheet" type="text/css" href="css/estil.css">
</head>
<body>
<?php
if (isset($_SESSION["usuariovalido"])){
$consultas="SELECT * FROM usuario";
$resultado=mysql_query($consultas)or die(mysql_error());
?>

<table border='1'>"
<tr>
     <th>id_usuario</th>
      <th>Nombre</th>
      <th>Apellido Paterno</th>
      <th>Apellido Materno</th>
      <th>Sexo</th>
      <th>Edad</th>
      <th>Domicilio</th>
      <th>Fecha</th>
      <th>usuario</th>
      <th>pswd</th>
   

</tr>

<?php
while($filas=mysql_fetch_array($resultado)){

?>
<tr><td><?php echo $filas['id_usuario']?></td>
<td><?php  echo $filas['Nombre']?></td>
<td><?php echo $filas['ApellidoPaterno']?></td>
<td><?php echo $filas['ApellidoMaterno']?></td>
<td><?php echo  $filas['Sexo']?></td>
<td><?php echo $filas['Edad']?></td>
<td><?php echo $filas['Domicilio']?></td>
<td><?php echo $filas['Fecha']?></td>
<td><?php echo $filas['usuario']?></td>
<td><?php echo $filas['pswd']?></td>



<?php

  //echo "<td><a href='editar.php?id_usuario=$filas[id_usuario]'>Editar</a></td>";
  //echo "<td><a href='eliminar.php?usuario=$filas[id_usuario]'>Eliminar</a></td>";


///echo "Tu id es: ".$filas['id_usuario']."<br>";
//echo "Tu Nombre es: ".$filas['Nombre']."<br>";
//echo "Tu Apelldido Paterno es: ".$filas['ApellidoPaterno']."<br>";
//echo "Tu Apellido Materno es: ".$filas['ApellidoMaterno']."<br>";
//echo "Tu Sexo es: ".$filas['Sexo']."<br>";
//echo "Tu Edad es: ".$filas['Edad']."<br>";
//echo "Tu Domicilio es: ".$filas['Domicilio']."<br>";
//echo "Tu Fecha es: ".$filas['Fecha']."<br>";
?>
</tr>

<?php
}
echo "<a href='index.php'>regresar</a>"
?>
</table>

<?php
   }else{

       echo "Acceso denegado";  
   }
?>

</body>
</html>

No hay comentarios.:

Publicar un comentario