Skip to content

Instantly share code, notes, and snippets.

@debojyoti
Created September 20, 2018 13:53
Show Gist options
  • Save debojyoti/3955e7f90e37397be5446ecf39247388 to your computer and use it in GitHub Desktop.
Save debojyoti/3955e7f90e37397be5446ecf39247388 to your computer and use it in GitHub Desktop.

Enable CORS in xampp

Step-1

In php files put these 2 lines at the top of the file

<?php
header('Content-Type: application/json');
header('Access-Control-Allow-Headers: *');

Step-2

Add a .htaccess file in the the root directory of server side files and the line

Header set Access-Control-Allow-Origin "*"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment