PROBLEMA CON EL SISTEMA DE AUTENTICACIÓN DE MI PÁGINA WEB.
Publicado por Santiago (1 intervención) el 30/05/2012 17:42:59
¡Hola chicos! Tengo un problema con el sistema de autenticación de mi página web. Dicho sistema de autenticación es muy sencillo (tan sumamente sencillo que, de momento, sólamente acepta un usuario y una contraseña), pide que el usuario introduzca su nombre de usuario y contraseña y envía esos datos a un archivo de control (control.php); que se encarga de comprobar si dichos datos son correctos o no. En el caso de que no lo sean reenvía al usuario a la página de acceso.
El problema está en que, aunque introduzca los datos correctos, siempre me redirige a la página de acceso. Los códigos, tanto el de la página de acceso como el del archivo control.php, son los siguientes:
PÁGINA DE ACCESO:
CONTROL.PHP:
¿Cúal puede ser el error?
El problema está en que, aunque introduzca los datos correctos, siempre me redirige a la página de acceso. Los códigos, tanto el de la página de acceso como el del archivo control.php, son los siguientes:
PÁGINA DE ACCESO:
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
122
123
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:282px;
top:55px;
width:280px;
height:36px;
z-index:1;
}
#Layer2 {
position:absolute;
left:683px;
top:61px;
width:260px;
height:33px;
z-index:2;
}
#Layer3 {
position:absolute;
left:50px;
top:231px;
width:174px;
height:43px;
z-index:3;
}
#Layer4 {
position:absolute;
left:49px;
top:354px;
width:172px;
height:47px;
z-index:4;
}
#Layer5 {
position:absolute;
left:50px;
top:499px;
width:174px;
height:51px;
z-index:5;
}
#Layer6 {
position:absolute;
left:277px;
top:115px;
width:718px;
height:549px;
z-index:6;
}
-->
</style>
</head>
<body>
<div id="Layer1">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="279" height="35">
<param name="BGCOLOR" value="#663399">
<param name="movie" value="botón6.swf">
<param name="quality" value="high">
<embed src="botón6.swf" width="279" height="35" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#663399"></embed>
</object>
</div>
<div id="Layer2">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="257" height="31">
<param name="BGCOLOR" value="#663399">
<param name="movie" value="botón7.swf">
<param name="quality" value="high">
<embed src="botón7.swf" width="257" height="31" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#663399"></embed>
</object>
</div>
<div id="Layer3">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="174" height="43">
<param name="BGCOLOR" value="#663399">
<param name="movie" value="botón1.swf">
<param name="quality" value="high">
<embed src="botón1.swf" width="174" height="43" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#663399"></embed>
</object>
</div>
<div id="Layer4">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="171" height="46">
<param name="BGCOLOR" value="#663399">
<param name="movie" value="botón3.swf">
<param name="quality" value="high">
<embed src="botón3.swf" width="171" height="46" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#663399"></embed>
</object>
</div>
<div id="Layer5">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="172" height="52">
<param name="BGCOLOR" value="#663399">
<param name="movie" value="botón4.swf">
<param name="quality" value="high">
<embed src="botón4.swf" width="172" height="52" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#663399"></embed>
</object>
</div>
<img src="../../Pictures/Plantilla%20web%20Liolio.jpg" width="1052" height="730">
<div id="Layer6">
<form action="control.php" method="POST">
<table align="center" width="225" cellspacing="2" cellpadding="2" border="0">
<tr>
<td colspan="2" align="center" bgcolor=#663399><b>Introduce tu clave de acceso</b></td>
</tr>
<tr>
<td align="right">USER:</td>
<td><input type="Text" name="usuario" size="8" maxlength="50"></td>
</tr>
<tr>
<td align="right">PASSWORD:</td>
<td><input type="password" name="contrasena" size="8" maxlength="50"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="Submit" value="ENTRAR"></td>
</tr>
</table>
</form>
</body>
</html>
CONTROL.PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<?php
//vemos si el usuario y contraseña es váildo
if ($_POST["usuario"]=="maria" && $_POST["contrasena"]=="lalo"){
//usuario y contraseña válidos
//defino una sesion y guardo datos
session_start();
$_SESSION["autentificado"]= "SI";
header ("Location: clientes.php");
}else {
//si no existe le mando otra vez a la portada
header("Location: área_clientes.htm?errorusuario=si");
}
?>
<body>
</body>
</html>
Valora esta pregunta
0