Guest User

Untitled

a guest
Mar 29th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. TESTLOGIN.PHP
  2.  
  3.  
  4. <!DOCTYPE html>
  5. <html lang="en">
  6.  
  7. <head>
  8.  
  9. <meta charset="utf-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta name="viewport" content="width=device-width, initial-scale=1">
  12.  
  13. <!-- CSS -->
  14. <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">
  15. <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
  16. <link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css">
  17. <link rel="stylesheet" href="assets/css/form-elements.css">
  18. <link rel="stylesheet" href="assets/css/style.css">
  19.  
  20. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  21. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  22. <!--[if lt IE 9]>
  23. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  24. <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  25. <![endif]-->
  26.  
  27. <!-- Favicon and touch icons -->
  28. <link rel="shortcut icon" href="assets/ico/favicon.png">
  29. <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
  30. <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
  31. <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
  32. <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
  33.  
  34. </head>
  35.  
  36. <body>
  37.  
  38.  
  39.  
  40. <?php
  41. session_start();
  42.  
  43. $user='root';
  44. $passw='';
  45. $database='testDB';
  46.  
  47. $con=mysqli_connect('localhost',$user,$passw,$database) or die("Error could not connect to DB");
  48.  
  49. if(isset($_POST['email']) && isset($_POST['password'])) {
  50. $email1 = $_POST['email'];
  51. $password1 = $_POST['password'];
  52.  
  53. if(!empty($_POST['email']) && !empty($_POST['password'])) {
  54. $sql="select * from logininfo where email='$email1' and password='$password1';";
  55. $result=mysqli_query($con,$sql) or die("failed to query");
  56. $row=mysqli_fetch_array($result);
  57.  
  58. if($row['Email'] == $email1 && $row['Password'] == $password1){
  59. $_SESSION['email']=$email1;
  60. header('Location:DemoHomePage.php');
  61. }
  62. else
  63. echo "Incorrect details !";
  64. }
  65. else
  66. echo "Empty text";
  67. }
  68.  
  69. ?>
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76. <!-- Top content -->
  77. <div class="top-content">
  78.  
  79. <div class="inner-bg">
  80. <div class="container">
  81.  
  82. <div class="row">
  83. <div class="col-sm-5">
  84.  
  85. <div class="form-box">
  86. <div class="form-top">
  87. <div class="form-top-left">
  88. <h3>Login to our site</h3>
  89. <p>Enter username and password to log on:</p>
  90. </div>
  91. <div class="form-top-right">
  92. <i class="fa fa-key"></i>
  93. </div>
  94. </div>
  95. <div class="form-bottom">
  96. <form role="form" action="<?php 'test.php'; ?>" method="post" class="login-form">
  97. <div class="form-group">
  98. <label class="sr-only" for="form-username">Email</label>
  99. <input type="text" name="email" placeholder="Email..." class="form-username form-control" id="form-username">
  100. </div>
  101. <div class="form-group">
  102. <label class="sr-only" for="form-password">Password</label>
  103. <input type="password" name="password" placeholder="Password..." class="form-password form-control" id="form-password">
  104. </div>
  105. <button type="submit" class="btn">Sign in!</button>
  106. </form>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111.  
  112. </div>
  113. </div>
  114.  
  115. </div>
  116.  
  117. <!-- Javascript -->
  118. <script src="assets/js/jquery-1.11.1.min.js"></script>
  119. <script src="assets/bootstrap/js/bootstrap.min.js"></script>
  120. <script src="assets/js/scripts.js"></script>
  121.  
  122. <!--[if lt IE 10]>
  123. <script src="assets/js/placeholder.js"></script>
  124. <![endif]-->
  125.  
  126. </body>
  127.  
  128. </html>
Add Comment
Please, Sign In to add comment