Ajax not working WAMP server?

Help! On the server, created a folder test in it put the files index.php in which such code:
<html>
the <head>
 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
 <script src="jquery-3.3.1min.js"></script>
 <script src="js.js"></script>
</head>
the <body>
<h1>Press</h1>

<?php
echo 'Data received - '.$_POST['text'];

?>

</body>
</html>

and file js.js in which such code:
$(function() {
 $('h1').click(function () {
$.ajax({
 url: 'index.php', /* Where will the request */
 method: 'post', /* transmission Method (post or get) */
 /* The data type in the response (xml, json, script, html). */
 data: {text: 5}, /* Parameters passed in the request. */
 success: function(data){ /* function to be executed after a successful request. */
 console.log(data); /* The data variable contains the response from index.php. */
}
});
});
});

When you press "Click" in the console this message appears:
<html>
the <head>
 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
 <script src="jquery-3.3.1min.js"></script>
 <script src="js.js"></script>
</head>
the <body>
<h1>Press</h1>

Data received - 5
</body>
</html>

i.e. the ajax seems to work. But in the browser appears the error: Notice: Undefined index: text in D:\Wamp\www\tost\index.php on line 12Call Stack#TimeMemoryFunctionLocation10.0008356792{main}( )...\index.php:0. The number 5 is not displayed.

Can I have WAMP somehow not working properly?
April 19th 20 at 12:10
0 answer

Find more questions by tags WAMPHTMLjQueryJavaScriptAJAX