1981191919 0 Newbie Poster

I am required to pass a parametre to jquery post and then get it using $_POST method .But it doesnt work this way.I cant display on the page

<!doctype html>
<html lang="en">
<head>

<title>Document</title>
<script
        src="https://code.jquery.com/jquery-3.3.1.js"
        integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
        crossorigin="anonymous"></script>
<script
        src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"
    integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30="      crossorigin="anonymous"></script>

</head>
<body>

<?php

@$a = isset($_POST["isim"]) ? "var" : "yok";
echo $a;

?>
<button type="button" id="tikla">Tıkla</button>

</body>
</html>

<script>

    $(document).ready(function(){
        $('#tikla').click(function () {
            $.post( "xx.php", {"isim": "tayfun"})
                .done(function(data){

                });
        })
    })

</script>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.