- Forums
- Domain Names
- PHP Enable/Allow CORS - Cross-origin Resource Sharing Website Domain
This Page Contains information about PHP Enable/Allow CORS - Cross-origin Resource Sharing Website Domain By dd in category Domain Names with 0 Replies. [5096], Last Updated: Mon Jun 24, 2024
dd
Sun Mar 12, 2023
0 Comments
403 Visits
To allow your Backend server APIs to access your PHP file, you can use the following headers in you PHP code:
If you want to allow a specific domain:
header("Access-Control-Allow-Origin: http://www.example.com");
header("Content-Type: application/json; charset=UTF-8");
Any domain:
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
2zKoS8GsKK8