Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>
- </title>
- </head>
- <style>
- body{
- background-color:#DCDCDC;
- margin:0px;
- }
- #page{
- background-color:white;
- border:5px solid white;
- width:75%;
- margin-left:auto;
- margin-right:auto;
- padding:15px;
- }
- #regi{
- margin:0px;
- padding:0px;
- margin-left:500px;
- margin-right:auto;
- }
- </style>
- <body>
- <div id="page">
- <h1 align="center">LOGIN</h1>
- </div>
- <form method="POST">
- <?php
- $con=mysql_connect('localhost','root') or die('error');
- $query=mysql_select_db('login',$con);
- if(isset($_POST['submit'])){
- $aw=$_POST['username'];
- $we=$_POST['password'];
- $sql=mysql_query("SELECT * FROM login_tbl WHERE username = '$aw' && password = '$we'");
- while($rows=mysql_fetch_array($sql));
- $user=$rows['username'];
- $pass=$rows['password'];
- if($user==$aw && $pass==$we){
- echo 'login';
- }
- else{
- echo 'doesnt match';
- }
- }
- ?>
- <br>
- <br>
- <br>
- <br>
- <div id ="regi">
- USERNAME:<input type="text" name="username">
- <br/>
- PASSWORD:<input type="password" name="password">
- <br/>
- <input type="submit" name="submit" value="submit">
- </div>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment