Saturday, January 30, 2016
How To Enable Cross-Origin Resource Sharing
.
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the resource originated. (wikipedia)
We can set a website to allow CORS by writing Header specification in .htaccess file (available on Apache server.
Refer this tutorial to set the Header Specification that enables CORS.
.
Besides that, we can also add the following codes into the PHP script that we are sending request to.
<?php
header("Access-Control-Allow-Origin: *");
...
Subscribe to:
Post Comments (Atom)
Labels
apt-get
(2)
bash
(4)
Chrome
(1)
CMS
(1)
code-igniter
(1)
codenvy
(1)
composer
(6)
eclipse che
(1)
error
(4)
file-permission
(1)
firebase
(2)
Free PHP Hosting
(11)
FuelPHP
(3)
git
(4)
jwt
(1)
laravel
(10)
mysql
(1)
OpenShift
(1)
php
(11)
PHP Eclipse
(9)
PHP Joomla
(2)
PHP Laravel
(4)
PHP Yii
(9)
PHP-JBOSS
(2)
php-jwt
(2)
PHP-Wordpress
(8)
plain php
(1)
Postman
(1)
REST
(2)
sqlite
(1)
sudo
(1)
visual-studio
(4)
xampp
(4)
No comments:
Post a Comment