Ver Mensaje Individual
  #6 (permalink)  
Antiguo 30/04/2003, 13:35
enadoquer
 
Fecha de Ingreso: agosto-2002
Mensajes: 22
Antigüedad: 21 años, 8 meses
Puntos: 0
De logueo.php a pantalla.php paso mediante header. Te paso los scripts completos:

/* logueo.php */
<?php
$u = $_POST["usuario"];
$c = $_POST["clave"];
include("conexion.php");
$sql = mysql_query("select * from usuarios where usuario = '$_POST[usuario]' and clave = '$_POST[clave]'");
$sql2 = mysql_query("select cargo from cargos where cod_cargo = '$_SESSION[cod]'");
if(mysql_num_rows($sql) <> 0 & $u == mysql_result($sql, 0, "usuario") & $c == mysql_result($sql, 0, "clave")){
session_start();
if (!isset($_SESSION['usu'])) {
$_SESSION['usu'] = mysql_result($sql, 0, "usuario");}
header("Location: pantalla.php");}
else{
echo "<center>El nombre de usuario y/o clave son incorrectas. Haz clic ".
"<a href='http://localhost/comunicaciones'>aquí.</a><br>".
"<br>El sistema distingue mayúsculas y minúsculas</center>";}
mysql_close($con);
?>

/* pantalla.php */
<html>
<head>
<title></title>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<link href="../estilo.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width='75%' height='297' border='1' align='center' cellpadding='0' cellspacing='0'>
<tr align='center' valign='middle'>
<td height='69' colspan='3' class='titulo'>
<?php
session_start();
if (session_is_registered("usu")){
echo $_SESSION['usu'];}
else{
echo "No esta registrada".$usu;}
?>
</td>
</tr>
<tr align='center' valign='middle'>
<td width='33%' height='26'><a href='pantalla.php?o=b' class='texto'>Bandeja
de entrada</a></td>
<td width='33%'><a href='pantalla.php?o=m' class='texto'>Mensajes</a></td>
<td width='33%'><a href='pantalla.php?o=n' class='texto'>Notas</a></td>
</tr>
<tr align='center' valign='middle'>
<td height='200' colspan='3' class='texto'>
<?php
if(isset($_GET['o'])){
if($_GET['o'] == 'b'){
include('bandeja.php');}
if($_GET['o'] == 'm'){
include('cargos.php');}
if($_GET['o'] == 'n'){
include('notas.php');}
}
else{
session_start();
echo "Bienvenido";}
?>
</td>
</tr>
</table>
</body>
</html>