Advertisement
Guest User

Code

a guest
Oct 1st, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.53 KB | None | 0 0
  1. <?php
  2. session_start();
  3.     if (isset($_POST['login'])){
  4.         require 'connect.php';
  5.         $username=$_POST['username'];
  6.         $password=$_POST['password'];
  7.         //$username=stripslashes($username);
  8.         //$password=stripslashes($password);
  9.         //$username=mysql_real_escape_string($username);
  10.         //$password=mysql_real_escape_string($password);
  11.         mysqli_query($con, "select * from customer_table where username = '$username' and password = '$password'");
  12.         $numrows = mysqli_num_rows($result);
  13.          if($numrows > 0)
  14. {
  15. echo $numrows;
  16. }
  17.         if(mysqli_num_rows($result)==1){
  18.             $_SESSION['username'] = $username;
  19.             header('location: cluserhome.php');
  20.     }
  21.             else
  22.                 echo "Username or password is invalid.";
  23. }
  24.     ?>
  25. <html>
  26. <head>
  27.     <title> Capslove/Login</title>
  28.     <link rel = "stylesheet" type = "text/css" href = "clh.css">
  29. </head>
  30. <body>
  31.     <?php
  32.         include '@logo.php';
  33.     ?>
  34.     <div class="board">
  35.     <form name="login" method="post" action="cllogin.php?action=login">
  36.         <table align="center">
  37.             <tr>
  38.             <th colspan="2">Login</th>
  39.             </tr>
  40.            
  41.             <tr>
  42.                 <td colspan="2"><input type="text" placeholder="Username" name="username" required="required">
  43.                 </td>
  44.             </tr>
  45.             <tr>
  46.                 <td colspan="2"><input type="password" placeholder="Password" name="password" required="required">
  47.                 </td>
  48.             </tr>
  49.             <tr>
  50.                 <td><input type="submit" value="Log in" name = "login"></td>
  51.                 <td><a href="clforgot.php">Forgot password?</a></td>
  52.                 </tr>
  53.         </table>
  54.         </form>
  55.     </div>
  56.    
  57.     <?php
  58.    
  59.         include '@footer.php';
  60.     ?>
  61.    
  62. </body>
  63.  
  64. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement