Reputation: 9
I want to send the form data that I filled out to the master user in phpmyadmin, but when I fill out and submit a submit, I receive that old error, I'm sorry for the English, I'm Brazilian, I've already searched in several places, nothing that would make me understand and make it work, can anyone help me?
Upvotes: 0
Views: 962
Reputation: 1122
Just add this on top of the retrive.php file,
<?php
header("Access-Control-Allow-Origin: *");
header('Access-Control-Allow-Origin: http://localhost', false);
echo 'Hello World';
?>
In the PHP code above, I am telling the browser that http://localhost has permission to make cross-domain requests to my website. The second parameter of PHP’s header function has been set to FALSE so that it is not overwritten by any other Access-Control-Allow-Origin headers that we may add in the future.
Reference page: CORS on PHP
Upvotes: 1