djchinezu2
New Pleskian
I have included this javascript on other domains:
In console of browser I have this error:
getlocker.php contains some php and html code!
I using
and I have tried by adding in getlocker.php:
But still not working!
Any idea? Thank you!
PHP:
var id = "<?php echo check_input($_GET['token']); ?>";
var querystring = "";
var lockerurl = "https:\/\/www.example.com\/contentlocker\/getlocker.php?" + 'id=' + encodeURIComponent(id) + '&r=' + encodeURIComponent(referrer) + querystring;
var iframecontents;
var old_display;
function optionstoquery(options) {
var query = "";
if (options.mt) query += "&mt=" + encodeURIComponent(options.mt);
if (options.dt) query += "&dt=" + encodeURIComponent(options.dt);
if (options.dd) query += "&dd=" + encodeURIComponent(options.dd);
if (options.md) query += "&md=" + encodeURIComponent(options.md);
return query;
}
function og_load(options) {
if (options) lockerurl += optionstoquery(options);
//preload
var xhr = new XMLHttpRequest();
xhr.open('GET', lockerurl, true);
xhr.onreadystatechange = function() {
if (this.readyState!==4) return;
if (this.status!==200) {
iframecontents = false;
return;
}
iframecontents = this.responseText;
};
xhr.send();
ogEditBody();
}
In console of browser I have this error:
Code:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.example.com/contentlocker/getlocker.php?id=3e066b64a78214a17620b5521b6d3ec4&r=aHR0cDovL2NwYWh1Yi51cy9yb29zdGVyMi5odG1s. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
getlocker.php contains some php and html code!
I using
- OS: Ubuntu 16.04.4 LTS
- Product: Plesk Onyx 17.8.11
and I have tried by adding in getlocker.php:
Code:
header('Access-Control-Allow-Origin: *');
Any idea? Thank you!