Access-Control-Allow-Origin: Origin is therefore not allowed access

shape
shape
shape
shape
shape
shape
shape
shape

When the client application makes a request to a port other than the origin port, the server usually returns in its header which origins are allowed, so the browser issues the Warning in its console:

How to solve the problem?

Considering that the server uses PHP, to solve the problem add the following line at the beginning of your code:

<?php
header('Access-Control-Allow-Origin: *');
?>

This will allow requests to be sent from any source.

Leave a Reply

Your email address will not be published. Required fields are marked *

Latest news

Latest news directly from our blog.