I am currently trying to set up a request such that when a button is clicked, it runs uses ajax to call a php script to change stuff in the database. but I am having issues where I keep getting an error with the
this is the ajax request. anytime I run this. I get an error stating "Error 500 (internal server error)"
$.ajax({
            url:"./scripts/test.php", //the page containing php script
            type: "POST", //request type,
            data: {registration: "success"},
            success:function(result){
        
            console.log(result.abc);
            },
            error: function(req, textStatus, errorThrown) {
            alert('Ooops, something happened: ' + textStatus + ' ' +errorThrown);
            }
                 });
my php code:
<?php
echo "hello world";
?>
I dont know what could be causing this, but anytime I try this on my live website (or local) it doesnt want to work.
