Página web en que tengo el proyecto:
[URL="http://www.ofserker.netai.net"]http://www.ofserker.netai.net[/URL]
login.html:
Código HTML:
<?php
require_once('./config/funciones.php');
conectar('a', 'a', 'a',
'a');
include("mantenimiento.php");
?>
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6 lt8"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7 lt8"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8 lt8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<form action="login.php" method="POST" />
<meta charset="UTF-8" />
<title>OfSerker Web Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Login and Registration Form with HTML5
and CSS3" />
<meta name="keywords" content="html5, css3, form, switch, animation,
:target, pseudo-class" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/animate-
custom.css" />
</head>
<body>
<div class="container">
<!-- Codrops top bar -->
<div class="codrops-top">
<a href="">
</a>
<span class="right">
<a href=" http://www.youtube.com/user/OfSerker">
<strong>Back to the OfSerker's Youtube Channel</strong>
</a>
</span>
<div class="clr"></div>
</div><!--/ Codrops top bar -->
<header>
<h1>Welcome to<span> OfSerker</span> Page</h1>
<nav class="codrops-demos">
<B>Click en las Redes Sociales<B>
<a href="facebook-twitter.html"><font size =
+1>Facebook/Twitter</font></a>
</nav>
</header>
<section>
<div id="container_demo" >
<!-- hidden anchor to stop jump
http://www.css3create.com/Astuce-Empecher-le-scroll-avec-l-utilisation-de-
target#wrap4 -->
<a class="hiddenanchor" id="toregister"></a>
<a class="hiddenanchor" id="tologin"></a>
<div id="wrapper">
<div id="login" class="animate form">
<form action="login.php" autocomplete="on">
<h1>Log in</h1>
<p>
<label for="username" class="uname" data-
icon="u" > Tú Usuario </label>
<input id="username" name="username"
required="required" type="text" placeholder="Mi Usuario"/>
</p>
<p>
<label for="password" class="youpasswd" data-
icon="p"> Tú Contraseña </label>
<input id="password" name="password"
required="required" type="password" placeholder="Ej: X8df!90EO" />
</p>
<p class="keeplogin">
<input
type="checkbox" name="loginkeeping" id="loginkeeping" value="loginkeeping" />
<label
for="loginkeeping">Mantenme logueado</label>
</p>
<p class="login button">
<input type="submit" value="Login" />
</p>
<p class="change_link">
No eres
miembro todavía ?
<a
href="register.html" class="to_register">Únete Ahora</a>
</div>
</div>
</div>
</section>
</div>
</body>
</html>
Código PHP:
<?php
session_start();
require_once('./config/funciones.php');
conectar('ma', 'a', 'a', 'a');
include("mantenimiento.php");
//Variables
$username = strip_tags($_POST['username']);
$password = strip_tags(sha1($_POST["password"]));
$activado = ("SELECT * FROM users WHERE activado = ''");
$query = mysql_query("SELECT * FROM users WHERE
user='".mysql_real_escape_string($username)."'
pass='".mysql_real_escape_string($password)."'
AND activado='".mysql_real_escape_string($activado)."'");
//Correcte fins aqui
if($existe = mysql_fetch_object($query))
{
if($existe->activado != 1) {
echo 'Primero activa tu cuenta entrando a tu correo';
}else{
$_SESSION['logged'] = 'yes';
$_SESSION['username'] = $username;
echo '<script>window.location="ofserker.php"</script>';
}
}else{
echo 'El usuario y/o pass son incorrectos.';
}
?>
Atentamente, OfSerker.