Notice: Undefined index..
Publicado por yada (2 intervenciones) el 26/09/2013 20:32:54
necesito que me ayuden Porfavor....
al momento de cargar la pagina de inicio de sesion me muestra el siguiente error:
! ) Notice: Undefined index: permisos in C:\wamp\www\proyecto\login.php on line 40
Call Stack
No se ha que se debe el error pero no se como hacer para que no se visualice....
Aqui esta el codigo realizado:
al momento de cargar la pagina de inicio de sesion me muestra el siguiente error:
! ) Notice: Undefined index: permisos in C:\wamp\www\proyecto\login.php on line 40
Call Stack
No se ha que se debe el error pero no se como hacer para que no se visualice....
Aqui esta el codigo realizado:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
include("conexion.php");
if(isset($_POST['login']))
{
$nom= $_POST['nom'];
$pass= md5(md5($_POST['pass']));
$b_user=mysql_query("SELECT * FROM users WHERE nom='$nom'");
$ses = @mysql_fetch_assoc($b_user) ;
if(@mysql_num_rows($b_user))
{
if($ses['pass'] == $pass)
{
$_SESSION['id']= $ses["id"];
$_SESSION['nom']= $ses["nom"];
$_SESSION['pass']= $ses["pass"];
$_SESSION['mail']= $ses["mail"];
$_SESSION['permisos']= $ses["permisos"];
}
else
{
echo 'Nombre de usuario o Contraseña incorrecta.';
}
}
else
{
echo 'Nombre de Usuario o contraseña incorrecta.';
}
}
if(isset($_GET['modo']) == 'desconectar')
{
session_destroy();
echo '<meta http-equiv="Refresh" content="1;url=index.php"> ';
exit ('Cerrando Sesion...');
}
if($_SESSION['permisos']==1)
{
echo '<div align="center"><b>Bienvenido <b>' . $_SESSION['nom'] . '</div></b><br /><br />';
echo '<meta http-equiv="Refresh" content="2;url=indexx.php"> '; //direccionamos al menu
exit ('<div align="center"></div>');
}
else
{
?>
<html>
<head>
<link href="styles.css" media="screen" rel="stylesheet" type="text/css" />
<link href="styles.css" media="screen" rel="stylesheet" type="text/css" />
<link href="styles.css" media="screen" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
background-image: url(imagess/images.jpg);
background-color: #999999;
}
.Estilo1 {
font-family: "Times New Roman", Times, serif;
color: #FFFFFF;
}
.Estilo2 {
color: #FFFFFF
}
a:link {
color: #999999;
}
a:visited {
color: #999999;
}
body,td,th {
font-family: Times New Roman, Times, serif;
font-size: x-large;
color: #999999;
}
</style>
</head>
<body >
<table width="1281" border="0">
<tr>
<td width="143"> </td>
<td width="787" align="center"> </td>
<td width="337"><div align="right"><a href="index.php"></a><a href="index.php"><img src="imagess/logo1.jpg" width="127" height="163"></a></div>
<div align="right"></div></td>
</tr>
</table>
<h2 align="center" class="Estilo1 Estilo2">INICIO DE SESION </h2>
<h2 align="center" class="Estilo1"> ADMINISTRADOR</h2>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div align="left">
<label><span class="Estilo2">No tiene cuenta registrada</span><a href="registro.php"> <span style='color: #999999;'>Registrar</span></a></label>
</div>
<div align="center">
<form name="login_user" action="login.php" method="post" />
<dt><label>Nombre:</label></dt>
<input type='text' name='nom' /><br /><br />
<dt><label>Password</label></dt>
<input type="password" name='pass' /><br /><br />
<button type="submit" name="login">Entrar</button>
<button type="reset" name="Limpiar" >Cancelar</button>
</form>
</div>
<p>
<?php
}
?>
</p>
<p align="center"> </p>
</body>
</html>
Valora esta pregunta


0