Php Has Been Blocked By Cors Policy

[Solved] Php Has Been Blocked By Cors Policy | Php - Code Explorer | yomemimo.com
Question : php has been blocked by CORS policy

Answered by : alemhar-salihuddin

header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET,HEAD,OPTIONS,POST,PUT");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");

Source : https://thisinterestsme.com/no-access-control-allow-origin/ | Last Update : Sun, 25 Oct 20

Question : php has been blocked by CORS policy

Answered by : borma425

public function __construct() { parent::__construct(); $this->load->model('api_model'); $this->load->library('form_validation'); Header('Access-Control-Allow-Origin: *'); //for allow any domain, insecure Header('Access-Control-Allow-Headers: *'); //for allow any headers, insecure Header('Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE'); //method allowed
//Or header('Access-Control-Allow-Origin: website_url'); header("Content-Type: application/json; charset=UTF-8"); Header('Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE'); //method allowed }

Source : https://stackoverflow.com/questions/41610470/codeigniter-cors-policy-no-access-control-allow-origin-error-how-to-resolve | Last Update : Fri, 26 Aug 22

Answers related to php has been blocked by cors policy

Code Explorer Popular Question For Php