Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div style="height:100%;width:50%;" class='left'>
- <form action="" method="POST">
- <input class='username' type='text' name='username'><br>
- <input class='pw' type='password' name='password'><br>
- <input class='submit' type='submit' id='login_btn' name='submit'>
- </form>
- </div>
- <div style="height:100%;width:50%;" class='right'>
- </div>
- html, body {
- margin: 0;
- padding: 0;
- overflow:hidden;
- }
- .left {
- background: url(ui/left.png);
- position:absolute;
- background-position: center left;
- background-size:cover;
- }
- .right {
- background: url(ui/right.png);
- background-position: center right;
- position:absolute;
- background-size:cover;
- right:0px;
- }
- input {
- outline:none;
- }
- .username {
- border:none;
- width:565px;
- height:69px;
- background: url(ui/textbox.png);
- margin-top:300px;
- margin-left:120px;
- font-size:2em;
- text-align:center;
- color:white;
- }
- .pw{
- border:none;
- width:565px;
- height:69px;
- background: url(ui/textbox.png);
- margin-top:60px;
- margin-left:120px;
- font-size:2em;
- text-align:center;
- }
- .submit{
- border:none;
- width:446px;
- height:85px;
- background: url(ui/button.png);
- margin-top:60px;
- margin-left:210px;
- font-size:2em;
- text-align:center;
- color:white;
- }
- <?php
- include("config.php");
- session_start();
- if($_SERVER["REQUEST_METHOD"] == "POST") {
- // username and password sent from form
- $myusername = mysqli_real_escape_string($db,$_POST['username']);
- $mypassword = mysqli_real_escape_string($db,$_POST['password']);
- $sql = "SELECT id FROM uzivatele WHERE login = '$myusername' and heslo = '$mypassword'";
- $result = mysqli_query($db,$sql);
- $row = mysqli_fetch_array($result,MYSQLI_ASSOC);
- $count = mysqli_num_rows($result);
- // If result matched $myusername and $mypassword, table row must be 1 row
- if($count == 1) {
- $_SESSION['login_user'] = $myusername;
- echo " $('.left').animate({left: '250px'});";
- }else {
- }
- }
- ?>
Add Comment
Please, Sign In to add comment