Cross-Origin Request Blocked

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.

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:

Header add Access-Control-Allow-Origin "*"