I searched the advised questions and my code seems to be correct but it
Here is my html code first with the implemented js code
<form>
<input id="inhalt" type="text" name="eingabe">
<button type="button" id="button" value="bestätigen">Transfer</button>
</form>
<script>
$('#button').click(function(){
var variableAjax = $('#inhalt').val();
console.log(variableAjax);
$.ajax({
type:"POST",
url: "html.php",
data: {
variableAjax : variableAjax,
},
success: function(data){
console.log("hallo"+data);
}
});
});
</script>
The PHP site
<?php
if(!empty($_POST['variableAjax'])){
$name = mysqli_real_escape_string($_POST['variableAjax']);
}
var_dump($name);
?>
Browser console I can see the entered value I have also implemented the required cdn
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
I have also following informations on my browser network
304
GET
localhost html.html?eingabe=dfadfads document html Aus Cache 833 B
304
GET
ajax.googleapis.com jquery.min.js script js Aus Cache 0 B
200
GET
localhost favicon.ico img x-icon Aus Cache 30,17 KB
200
POST
localhost html.php
On PHP site I get this information
Notice: Undefined variable: name in C:\xampp\htdocs\dashboard\YOUTUBE\TEST\html.php on line 8
NULL