0
script WEB2 modul 7
Posted by Rian Bahtiar
on
22.49
SECURE PROGRAMMING
buat file login.php
if(isset($_POST[submit])==true) {
$plaintextuname = 'bejo';
$chipertextpass = md5('bejo');
if (($_POST[uname] == $plaintextuname) && (md5($_POST[pass]) == $chipertextpass)) {
echo '<center> Berhasil </center>';
}
else {
echo '<center> Gagal </center>';
}
}
$login .= '<form method=\'post\'>';
$login .= '<table border=\'0\' align=\'center\'>';
$login .= '<tr> <td> Username</td> <td> <input type=\'text\'name=\'uname\'></td></tr>';
$login .= '<tr> <td> Password</td> <td> <input type=\'password\'name=\'pass\'></td></tr>';
$login .= '<tr> <td colspan=\'2\'><input type=\'submit\'value=\'login\' name=\'submit\'></td></tr>';
$login .= '</form>';
print $login;
?>
Posting Komentar