Advertisement
Guest User

Untitled

a guest
Dec 25th, 2012
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2. $user = $_POST['user'];
  3. $password = $_POST['password'];
  4. $query = mysql_query("SELECT * FROM $table where nama='$user'");
  5. $result = mysql_fetch_array($query);
  6. $row = mysql_num_rows($query);
  7. if(($user == "") && ($password == ""))
  8. {
  9. print "<center>Anda belum memasukkan username dan password !";
  10. exit;
  11. }
  12. if($row != 0)
  13. {
  14. if($password != $result['password'])
  15. {
  16. print "<center>Password salah !";
  17. }
  18. else
  19. {
  20. setcookie("nama",$user);
  21. print "<center>Anda telah berhasil login dengan nama
  22. $user<br><a href=index.php><font color=blue>Back to home</a>";
  23. }
  24. }
  25. else
  26. {
  27. print "<center>Maaf, Username tidak terdaftar !<br>Silahkan daftar dulu
  28. <a href='index.php?register=masukkan nama,email,dan password untuk daftar'><font
  29. color=blue>disini</a></font>";
  30. }
  31. ?>
  32. <?php mysql_close($connect); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement