Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting( ~E_DEPRECATED & ~E_NOTICE );
- define('DBHOST','localhost');
- define('DBUSER','id6394283_tarank');
- define('DBPASS','tarank');
- define('DBNAME','id6394283_db');
- $con=mysqli_connect(DBHOST,DBUSER,DBPASS) or die("cannot connect");
- $dbcon=mysqli_select_db($con,DBNAME) or die("cannot select DB");
- if(!$con)
- {
- echo "error connection";
- }
- ?>
- <html>
- <head>SQL</head>
- <body>
- <form method="post">
- <input type="text" name="username" placeholder="Username"><br>
- <input type="text" name="password" placeholder="Password"><br>
- <input type="submit" name="submit">
- </form>
- <?php
- if(isset($_POST["submit"]))
- {
- $username=$_POST["username"];
- $password=$_POST["password"];
- $query="select *from tb1 where(username='$username') and (password='$password')";
- $result=mysqli_query($con,$query);
- if(mysqli_num_rows($reult)==1)
- {
- echo "Login Accepted";
- }
- else
- {
- echo "Login Rejected";
- }
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment