php_value display_errors 1
Header set Access-Control-Allow-Origin: URL of GitHub website
Header set Access-Control-Allow-Methods: “GET, POST, DELETE, OPTIONS”
When I send a POST request with data (a=larry) using XMLHttpRequest:
var cli = new XMLHttpRequest();
This is what happens in index.php:
echo $_GET[‘a’] returns larry
echo $POST[‘a’] returns null (‘a’ is undefined index)
If I add ‘a=larry’ into .send() --> cli.send(‘a=larry’) and take it off the end of the URL, both $_GET and $_POST return null
I don’t understand why the server (000webhost) is interpreting the POST request as a GET request. When I look at the request made by my GitHub website in dev on google chrome, it says it is a POST request.
I just want to send some data to index.php.