martes, 3 de diciembre de 2013

EJERCICIO QUE MUESTRA LOS DEBERES


PAGINA  QUE MUESTRA LOS DEBERES DE UN USUARIO

master.php
<?php
session_start();

?>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Openalfa -Validacion de Usuario</title>
</head>
<body bgcolor="white" text="navy">

     <table style="border:1px sky blue" width="99.7%"  cellspacing="20" cellpadding="40" align="center" >
 <fieldset  >
     <form action="deber.php" method="POST" >

    <fieldset  style="border:1px solid turquoise" >

    <?php
    require_once "encabezado.php"
?>
  </fieldset>

<td  class="cuadro" bgcolor="white">
<p>
        <label for="username">Usuario</label>
        <input id="username" type="text" name="username" size="18"/>
    </p>
    <p>
        <label for="passwd">Contraseña</label>
        <input id="passwd" type="password" name="password" size="18"/>
    </p>
         <p>
       
    <input type="submit" name="Submit" class="button" value="Entrar" />
      
<td class="cuadro" bgcolor="white">
Nombre: Alexandra Maguana
<br>
<br>
  Direccion:   Oriente y Vintimilla
 <br>
<br> 
  Telefono: 0979303560
 <br>
 <br>
 Tema:

</td>
</tr>
</table>
<fieldset >
<fieldset>
<?php
 require_once "pie.php"

?>
 </fieldset>
 </fieldset>
</fieldset>
</form>
</body>
</html>
central.php  
<?
include(encabezado.php);
//contedido a publicar
include(piedepagina.php);
?>
encabezado.php
<html>
<body>
<center> <h2>  Dise&ntildeo de Sistemas  </h2></center>
<img src="Alex1.jpg">
<?php
 echo "<h4> fecha: ". DATE("d-m-Y")."</h4>" ;
?>
</body>
</html>
pie.php
 <?php
echo "<center> Alexandra Maguana </center>";
echo "<br>";
 echo "<center> Todos lo derechos reservados </center>";
echo "<br>";
?>
registrado.php
<?php
session_start();
?>
<html>
<head>
<title>Registrado</title>
<meta http-equiv="Content-Type" Content="text/html; charset=UTF-8">
</head>
<body>
<?php
echo "<center> TEMAS </center>" ;
?>
<a href="suma.html">Deber Nro.1</a>
<br>
<a href="Clases.html">Deber Nro.2</a>
<br>
<a href="Variables de desision.html">Deber Nro.3</a>
<br>
<br>
<br>
<a href="Prin.php">REGRESAR</a>
</body>
</html>
deber.php
<?php
session_start();
if ($_POST["username"]=="Alexandra Maguana" && $_POST["password"]=="1234" ){
      $_SESSION["usuario"] = $_POST["username"];
    $_SESSION['clave']=$_REQUEST['password'];
    header ("Location: registrado.php");
    }
    else{
?>
<html>
<body>
    Error. Datos incorrectos
    <br>
    <a href="master.php">Inicio</a>
</body>
</html>
<?php
}
?>
EJECUCION
Al ejecutar con el servidor localhost nos muestra la siguiente ventana y llenamos los datos
 Al pulsar Entrar nos muestra  la siguiente ventana con los deberes que se debera cargar

 Hacemos clic en el deber del tema que deseamos  como ejemplo el de la suma nos muestra lo siguiente donde ingresamos los datos.
 Pulsamos sumar y nos muestra el resultado.

 


No hay comentarios:

Publicar un comentario