Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body><center>
- <form action="" method="POST">
- Username:-<input type="text" name="uname" required=""><br><br>
- Password:-<input type="text" name="upassword" required=""><br><br>
- <input type="submit" name="sub" value="Login">
- <form>
- </body></center>
- </html>
- <?php
- $cser=mysqli_connect("localhost","root","","tutorials"); //database connectivity
- if(isset($_POST['sub']))
- {
- $uname = $_POST['uname'];
- $upassword = $_POST['upassword'];
- $res = mysqli_query($cser,"select* from user where uname='$uname'and upassword='$upassword'");
- $result=mysqli_fetch_array($res);
- if($result)
- {
- echo "You are login Successfully ";
- }
- else
- {
- echo "failed ";
- }
- }
- ?>
Add Comment
Please, Sign In to add comment