Skip to content

Commit

Permalink
login msgs changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhis091 committed Jul 18, 2021
1 parent 1b34d09 commit 1ae9a73
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions login.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
<?php
require_once "connect.php";
require_once "./connect.php";

$sql="select userId from user where userId = '".$_POST['username']."' and password = '".md5($_POST['password'])."'";
$result=mysqli_query($con,$sql) or die($con->error);

if($result->num_rows==1){
echo "<script>
alert('Logged in');
window.location = './fill.html';
</script>";
// print_r($_POST);
$userID = $_POST['username'];
$pass = md5($_POST['password']);
$sql="select * from user where userId = '".$userID."' and password = '".$pass."' ";
$result=mysqli_query($con,$sql);

if($result){
if(mysqli_num_rows($result)==1){
echo "
<script>
alert('Logged in');
location.replace('fill.html');
</script>
";
}else{
echo "
<script>
alert('Invalid Credentials!!!!');
location.replace('index.html');
</script>
";
}
}else{
echo "
<script>
alert('Some Error Occured while loggin in!!!!);
location.replace('index.html');
</script>
";
}
?>

0 comments on commit 1ae9a73

Please sign in to comment.