I wonder how I can pass value from Jquery to PHP. I found similar codes but not even one of them work. Everytime alert shows value of variable but when I open site there is not any. Var_dump shows that $_POST is null. I am ran out of ideas do you have any?
jQuery code:
$("#password-button").click(function(){
 var password="";
 var numbers =[0,0,0,0,0,0];
 for(var i=0;i<=5;i++){
    numbers[i] = Math.floor((Math.random() * 25) + 65);
    password += String.fromCharCode(numbers[i]);
 }
   $(".LoginError").text("Nowe haslo: " + password);
  $.ajax({
                    type: 'post',
                    url: 'dzialaj.php',
                    data: {'password': password},
                    cache:false,
                    success: function(data)
                    {
                        alert(data);
                         console.log(result)
        console.log(result.status);
                    }
                });
});
PHP:
if(isset($_POST['password'])){
$temp = $_POST['password'];
echo $temp;
}
 
     
     
    