Codice PHP:
<?php session_start(); ?>
<Html>
<head>
<LINK REL=StyleSheet HREF="../stile.css" TYPE="text/css" MEDIA=screen>
</head>
<body onload= document.login.login.focus()>
<?php
include "config.php";
include "funzioni.php";
include "ok.php";
$DB = new DB();
unset($_SESSION['login']);
unset($_SESSION['psw']);
// Si connette
$DB->connect();
$login = trim(addslashes($_POST[login]));
$pass = trim(addslashes($_POST[psw]));
if ($login=='' or $pass==''){
echo"<form name='login' action='login.php' method='post'>
<table>
<tr><td>Username</td><td>Password</td></tr><tr>
<td><input name='login' type='text' size='10'></td>
<td><input name='psw' type='password' size='10' /></td>
<td><input type='submit' name='Accedi' value='Ok ' /></td>
</tr>
</table>
<br><center><a href = dimenticapass.php target = _home>Password Dimenticata</a></center>
";}
else
{
$psw_per_db = criptpass($pass);
$verifico_user = mysql_query("SELECT *
FROM utenti
WHERE `nickname` ='$login'
AND `password` = '$psw_per_db' and `stato` = '1'
LIMIT 0 , 1");
$ok_login = mysql_num_rows($verifico_user);
if($ok_login=="1")
{
$_SESSION[login] = $login;
$_SESSION[psw]= $psw_per_db;
$cook = "$_SESSION[login]@@$_SESSION[psw]";
setcookie("login", $cook,time()+3600,"/");
$set = "1";
Echo "<meta http-equiv=\"Refresh\" content=\"2; URL=saluto.php?".SID."\"><br><br><center>Login in corso...</center>";
}
else
{
Echo "<meta http-equiv=\"Refresh\" content=10\"; URL=saluto.php\">Login incorretto<br><a href=login/login.php>- Riprova</a><br>
<a href = dimenticapass.php target = _home>- Password Dimenticata</a>
";
}
}
?>
</body>
</html>
EDIT: Per una verifica sul posto..........www.mtballi.it