Skip to content

Instantly share code, notes, and snippets.

Created March 1, 2023 11:28
What would you like to do?
Allow cors in PHP
header("Content-Type: application/json;charset=utf-8");
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Content-Type, Authorization");
header("Access-Control-Allow-Methods: POST, OPTIONS");
header("Allow: POST, OPTIONS");
if ($method == "OPTIONS") {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment