PHP Cross-Origin Request Blocked -
just wanted find solution this. within system , make following call
$("#page-form").submit(function(event){ $.ajax({ type: "post", url: "https://someotherurl/process.php", data: { 'mobnumber': $("#mobile").val() } }).done(function (response) { alert(response); }); })
now makes call php file on server. php file nothing @ moment, have
<?php header("access-control-allow-origin: *"); header("access-control-allow-methods: put, get, post"); header("access-control-allow-headers: origin, x-requested-with, content-type, accept"); var_dump("1");
however getting cross origin request blocked error. why happening?
as side note, have no access server running system a, has done on server php file sits.
thanks
update
server seems have response headers
cache-control no-cache connection keep-alive content-type text/html; charset=utf-8 date thu, 25 jun 2015 12:31:50 gmt expires thu, 25 jun 2015 12:31:50 gmt keep-alive timeout=5, max=99 pragma no-cache server apache transfer-encoding chunked vary accept-encoding x-ua-compatible ie=edge
request headers
accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-encoding gzip, deflate accept-language en-us,en;q=0.5 connection keep-alive user-agent mozilla/5.0 (windows nt 6.1; wow64; rv:38.0) gecko/20100101 firefox/38.0
try in .htaccess file present @ root folder on https://someotherurl/ :
<ifmodule mod_headers.c> header set access-control-allow-origin "*" </ifmodule>
Comments
Post a Comment