Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- include "koneksii.php";
- if($_POST['username']) {
- $user = $_POST['username'];
- $pass = $_POST['password'];
- $sql = "SELECT * FROM user WHERE username = '$user' and password ='$pass'";
- $q = mysql_query($sql);
- $row = mysql_fetch_array($q);
- $name = $row['username'];
- if (!empty($row['username']))
- {
- echo '<script> alert("Welcome!!"); </script>';
- echo '<script type="text/javascript">
- window.location="index.php"
- </script>';
- }
- else
- {
- echo '<script> alert("GAGAL!!"); </script>';
- }
- }
- ?>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Login</title>
- <link href="http://danny4rt.blogspot.co.id/favicon.ico" rel="icon" type="image/x-icon"/>
- <link rel="stylesheet" type="text/css" href="style.css">
- <!--[if lt IE 9]>
- <script>
- document.createElement("article");
- document.createElement("aside");
- document.createElement("footer");
- document.createElement("header");
- document.createElement("main");
- document.createElement("nav");
- document.createElement("section");
- </script>
- <![endif]-->
- </head>
- <body background="img/bg1.jpg">
- }
- }
- <center>
- <style>
- section {
- text-align: center;
- height: 200px;
- width: 600px;
- background-color: #0ee060;
- margin-top: 5px;
- padding: 7px;
- padding-bottom: 5px;
- padding-top: 5px;
- border-radius: 20px;
- position: relative;
- }
- article {
- height: 200px;
- background-color: #c8fff7;
- margin-top: 5px;
- padding: 12px 22px;
- border-radius: 20px;
- position: relative;
- }
- </style>
- <section>
- <h2>Login</h2>
- <article>
- <header>
- <form name="form1" id="form1" action="login.php">
- Username:
- <input type="text" name="username" size="30">
- <br><br>
- Password:
- <input type="password" name="passsword" size="30">
- <br><br>
- <input type="submit" name="submit"value="login">
- </form>
- </header>
- </article>
- </section>
- </center>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement