Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (isset($_POST['login'])){
- require 'connect.php';
- $username=$_POST['username'];
- $password=$_POST['password'];
- //$username=stripslashes($username);
- //$password=stripslashes($password);
- //$username=mysql_real_escape_string($username);
- //$password=mysql_real_escape_string($password);
- mysqli_query($con, "select * from customer_table where username = '$username' and password = '$password'");
- $numrows = mysqli_num_rows($result);
- if($numrows > 0)
- {
- echo $numrows;
- }
- if(mysqli_num_rows($result)==1){
- $_SESSION['username'] = $username;
- header('location: cluserhome.php');
- }
- else
- echo "Username or password is invalid.";
- }
- ?>
- <html>
- <head>
- <title> Capslove/Login</title>
- <link rel = "stylesheet" type = "text/css" href = "clh.css">
- </head>
- <body>
- <?php
- include '@logo.php';
- ?>
- <div class="board">
- <form name="login" method="post" action="cllogin.php?action=login">
- <table align="center">
- <tr>
- <th colspan="2">Login</th>
- </tr>
- <tr>
- <td colspan="2"><input type="text" placeholder="Username" name="username" required="required">
- </td>
- </tr>
- <tr>
- <td colspan="2"><input type="password" placeholder="Password" name="password" required="required">
- </td>
- </tr>
- <tr>
- <td><input type="submit" value="Log in" name = "login"></td>
- <td><a href="clforgot.php">Forgot password?</a></td>
- </tr>
- </table>
- </form>
- </div>
- <?php
- include '@footer.php';
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement