JS Post TO PHP FILE [closed]

  javascript, jquery, php

Javascript code

document.getElementById("House").addEventListener("click", function() {
    const triggeredBtnId = sessionStorage.getItem('triggeredBtnId');
    document.querySelector(triggeredBtnId).style.backgroundImage = "url(./House.png)";
    document.querySelector(".BuildingMenu").style.display = "none";
    $.POST("SaveBuild.php",{
        plane1: "House"
    })
})

PHP Code

<?php
$plane1 = $_POST['plane1'];
echo "Invlid";
?>

so far all the code in works apart from the post, I’m not getting any errors showing up and I’m wondering what could be wrong any ideas?

Source: Ask PHP

LEAVE A COMMENT