<html>
<head>
<title>ajò</title>
<meta http-equiv="content_type" content="text/html; charset=utf-8">
</head>
<div align="center">
<form name ="login" method="post" action="check.php">
<table width="500" border="0">
<tr>
<td>username</td>
<td>
<input type="text" name="username">
</td>
</tr>
<tr>
<td>password</td>
<td>
<input type="password" name="password">
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" name="submit">
</div>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
<?php
include(./users.php)
if ( IsSet($_POST['username']) && IsSet($_POST['password']) ) {
if ( IsSet($users[$_POST['username'] ) {
if ( $users[$_POST['username']] == md5($_POST['password'] ) {
// login correct. fuck yeah.
} else {
// login incorrect. damn...
}
} else {
echo 'WTF? \'st\'utente non esiste!';
}
} else {
echo 'Caro pampino, devi scrivere user e pass per accedere, sai?';
}
?>
<?php
$users = array(
'giansebastiano' => 'passinmd5',
'osvoldo' => 'passinmd5'
)
?>
Ho scritto il tutto di fretta, vedi se ci sono errori...