I am trying to post a data on run time and I want to see this data same time. But I don't understand clearly how can I do. I think my problem is I could not choose the element correctly. What is wrong on my code ? Thanks all from now :)
My Error is : Notice: Undefined index: username in C:\wamp\www\eva\check.php on line 3
Line 3 : echo $username = $_POST["username"];
form.php
<html>
<head>
<title>jQuery</title>
</head>
<body>
<div class="formwrapper">
<form method="post" action="" name="form">
<input type="text" id="rname" class="inputa" name="uname" placeholder="Username">
<div id="feedback"></div>
</form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="myScript.js"></script>
</body>
</html>
check.php
<?php
echo $username = $_POST["uname"];
?>
myScript.js
$(document).ready(function() {
$("#feedback").load("check.php").show();
$("#rname").keyup(function() {
$.post("check.php", { username: uname.value },
function(result){
$("#feedback").html(result).show();
})
});
});
$('#rname').val()
?