Search
 
SCRIPT & CODE EXAMPLE
 

PHP

disable cors policy symfony

//his code in the file public/index.php work perfectly.

header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
header("Allow: GET, POST, OPTIONS, PUT, DELETE");
$method = $_SERVER['REQUEST_METHOD'];
if ($method == "OPTIONS") {
    die();
}

https://stackoverflow.com/a/60642286/7610978
Comment

PREVIOUS NEXT
Code Example
Php :: Creating a new laravelproject 
Php :: php increment letter 
Php :: php replace every occurrence of character in string 
Php :: get the category wp 
Php :: php get text from html 
Php :: how to add script in WordPress admin page 
Php :: delete method laravel 
Php :: php random name 
Php :: php mysqli connect err0r 
Php :: how to upload pdf file using php 
Php :: check if session is set 
Php :: test if php is installed 
Php :: get all artisan commands 
Php :: php create url with query sting from array 
Php :: php start server command 
Php :: random word using a wordlist php 
Php :: append file in php 
Php :: format money with commas in php 
Php :: password hash php 
Php :: laravel validation unique if this field is changed 
Php :: laravel echo query 
Php :: refresh a specific migration laravel 
Php :: get url with php 
Php :: laravel http retry 
Php :: define("ROOT PATH", __DIR__); 
Php :: php remove stop words from string 
Php :: how to bulk insert array into sql php 
Php :: get last letter in php 
Php :: percentage in php 
Php :: html php pass data to another page 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =