I’m using a Ajax call stored locally to call the server for information but for some reason I’m getting Cross-Origin Request Blocked even though the PHP file called has header("Access-Control-Allow-Origin: *") enabled.
header("Access-Control-Allow-Origin: *")
Anyway to solve this
Thanks.
Hi @ImOverlord!
If you attempt to retrieve the information from another server not related to 000webhost, make sure that server is configured to returns the headers.
Otherwise, please append the following code to /public_html/.htaccess and try again:
/public_html/.htaccess
Header add Access-Control-Allow-Origin "*"