Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php has been blocked by CORS policy

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");
Comment

php has been blocked by CORS policy

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
            }
Comment

PREVIOUS NEXT
Code Example
Php :: carbon start of day 
Php :: ucfirst() php 
Php :: laravel request all except token 
Php :: php array remove empty values 
Php :: php extract time from datetime 
Php :: laravel blade uppercase 
Php :: how to set no cache header php 
Php :: php get latest file in directory 
Php :: laravel ever over https 
Php :: hit a simple url using curl in php 
Php :: pi() in php 
Php :: mysql replace a character in a string 
Php :: php add element to array first position 
Php :: php curl post json 
Php :: orwherebetween laravel 
Php :: wordpress get archive title 
Php :: add tags to custom post type 
Php :: error log php array 
Php :: how to get browser info in php 
Php :: Disable wordpress wp cron 
Php :: php mkdir if not exists 
Php :: get current date laravel 
Php :: how get file size in laravel 
Php :: for loop php 
Php :: You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with `--ignore-platform-req=ext-curl` to temporarily ignore these required extensions. 
Php :: symfony clear cache 
Php :: how to delete image from aws using laravel 8 
Php :: 419 unknown status 
Php :: check input value is integer or not in php 
Php :: How to check current URL inside @if statement in Laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =