javascript - Cross Domain PHP -


i need references cross domain php codes, using javascript in php. reason why-

i trying create php file can accessed site, making test key, website user entered when signing if tries steal script not work on website.

i need know how cross domain php code, don't want users see javascript have written out, select bit. this

$name_of_service({key:"h292h2723h20hc-0239c",options:"option"}); 

can explain me best bet on how this, how give code user access php file such as...

$.get(php file); 

or of sort. first time dealing of newb on cross domain implementation. first site not allow php access can use website server. best explanations or best website explanation references please.

i appreciate anyones advice , tips. don't need more how end user server , hide overall javascript users, mean encrypt , use compiler though of whom know how decrypt isn't helpful either. thank you.

for future reference:

wikipedia gives answer here. you'll need add header access-control-allow-origin either in .htaccess file or .php file assuming working in apache-based environment. conveniently, php provides function header this.

for script work this, you'll need jquery send respective origin header server. can done using jqxhr.setrequestheader("origin", location.href);


Comments