Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ?>
- <html>
- <head>
- <style>
- * { margin: 0; padding: 0; box-sizing: border-box; }
- body {
- background:#596778;
- color: #5e5e5e;
- font: 400 87.5%/1.5em helvetica 'Open Sans', sans-serif;
- }
- .form-wrapper {
- background: #fafafa;
- margin: 3em auto;
- padding: 0 1em;
- max-width: 370px;
- }
- h1 {
- text-align: center;
- padding: 1em 0;
- }
- form {
- padding: 0 1.5em;
- }
- .form-item {
- margin-bottom: 0.75em;
- width: 100%;
- }
- .form-item input {
- background: #fafafa;
- border: none;
- border-bottom: 2px solid #e9e9e9;
- color: #666;
- font-family: 'Open Sans', sans-serif;
- font-size: 1em;
- height: 50px;
- transition: border-color 0.3s;
- width: 100%;
- }
- .form-item input:focus {
- border-bottom: 2px solid #c0c0c0;
- outline: none;
- }
- .button-panel {
- margin: 2em 0 0;
- width: 100%;
- }
- .button-panel .button {
- background: skyblue;
- border: none;
- color: #fff;
- cursor: pointer;
- height: 50px;
- font-family: 'Open Sans', sans-serif;
- font-size: 1.2em;
- letter-spacing: 0.05em;
- text-align: center;
- text-transform: uppercase;
- transition: background 0.3s ease-in-out;
- width: 100%;
- }
- .form-footer {
- font-size: 1em;
- padding: 2em 0;
- text-align: center;
- }
- .form-footer a {
- color: #8c8c8c;
- text-decoration: none;
- transition: border-color 0.3s;
- }
- .form-footer a:hover {
- border-bottom: 1px dotted #8c8c8c;
- }
- </style>
- </head>
- <body>
- <div class="form-wrapper">
- <h1>Indo Travel</h1>
- <form method="POST" action="">
- <div class="form-item">
- <label for="user"></label>
- <?php
- include("coo.php");
- if(isset($_POST["input"])){
- $a=$_POST["user"];
- $b=$_POST["password"];
- $query=mysql_query("SELECT * FROM user WHERE username='$a' AND password='$b'");
- if(mysql_num_rows($query) == 1){
- $row=mysql_fetch_array($query);
- $_SESSION['username']=$a;
- $_SESSION['ktp']=$row['no_ktp'];
- $_SESSION['almt']=$row['alamat'];
- $_SESSION['no_telp']=$row['telp'];
- header("Location:home.php");
- }else if($a=='admin' && $b='admin'){
- header("Location:admin.php");
- }
- else{
- echo"<center>Username atau Password salah</center>";
- }
- }
- ?>
- <input type="text" name="user" required="required" placeholder="Username"></input>
- </div>
- <div class="form-item">
- <label for="password"></label>
- <input type="password" name="password" required="required" placeholder="Password"></input>
- </div>
- <div class="button-panel">
- <input type="submit" name="input" class="button" title="Log In" value="Login"></input>
- </div>
- </form>
- <div class="form-footer">
- <p><a href="signup.php">Sign up</a></p>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement