views:

33

answers:

2

I've got two servers running jsp and php. I'd like the PHP page to call the JSP page for getting an output. I tried using simple Ajax and Jquery-Ajax, it doesn't seem to work. Why?

+1  A: 

you can't use ajax cross domains due to security restrictions. you could send the data to an php-script on your domain and send the post-request from there with a function like this

oezi
+1  A: 

AJAX cannot request pages from sites that reside in different servers. This will make it a cross-side scripting attack. Hence, you have to go only through your server side code. For PHP you can use curl to get information from other pages. You can now use the same ajax script and link it to the php page containing curl. Documentation of curl can be found if you give a google over it.

1s2a3n4j5e6e7v
CURL works thank you
Ricardo Slafford