I'm trying to login to my web application (made in react) and I'm using a xampp apache server on localhost, when I try to send post request to my php file it returns this error:
[Error] XMLHttpRequest cannot load http://localhost/project/authentication.php due to access control checks.
my request looks like this:
export async function doLogin(data: LoginCredentials) {
const res = await axios.post('http://localhost:80/project/authentication.php',
data
);
return await res.data;
}
what can I do?