I added isset to my check.php to get rid of an unidentified index error. The thing is, I’m not getting anything in div when I type something random in the login and password fields which is the goal here. What am I doing wrong? I’ve checked the code over and over and I can’t get the right answer
Here is my login.html:
<html>
<head>
<title> MYSQL </title>
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous">
</script>
</head>
<body>
<div id="status"></div>
<input id="login" placeholder="Login"><br>
<input type="password" id="pass" placeholder="Password"><br>
<button id="entry"> Login </button>
<script>
$("entry").click(function(){
$.post("check.php", {login: $("#login").val(), password: $("#pass").val()},
function(result){
$("#status").html(result);
})
})
</script>
</body>
</html>
Here my check.php:
<?php
$login=isset($_POST['login']);
$password=isset($_POST['password']);
echo $login.$password;
?>