Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to solve cors error in this structure? #4

Open
Kajal81198 opened this issue May 4, 2023 · 2 comments
Open

How to solve cors error in this structure? #4

Kajal81198 opened this issue May 4, 2023 · 2 comments

Comments

@Kajal81198
Copy link

I just make a login api and i want to fetch that api from my react application but it gives me cors error. so how can i solve this issue in this structure.

@Virtuallified
Copy link
Owner

Hi @Kajal81198 ,
Please add the below lines at the beginning of your php scripts.

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: X-Requested-With');

I hope that will resolve your problem.

@Kajal81198
Copy link
Author

Kajal81198 commented May 15, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants