Guest User

Untitled

a guest
Apr 19th, 2018
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2. ob_start();
  3. session_start();
  4. if(isset($_SESSION['akun_username'])) header("location: ../index.html");
  5. include "connection.php";
  6.  
  7. if(isset($_POST["submit_login"])){
  8. $username = $_POST['user'];
  9. $password = $_POST['pass'];
  10.  
  11. if(mysql_num_rows($sql_login)>0){
  12. $row_akun = mysql_fetch_array($sql_login);
  13. $_SESSION['akun_username'] = $row_akun["username"];
  14. $_SESSION['akun_password'] = $row_akun["password"];
  15. header('location:admin/dashboard.html');
  16. } else {
  17. header('location:index.html');
  18. echo "<script>alert('Username / Password Salah.');</script>";
  19. }
  20. }
  21. ?>
  22.  
  23. <span class="hidden-xs">Welcome, <?php echo $_SESSION['akun_username']; ?></span>
Add Comment
Please, Sign In to add comment