开发者

Can resources requested via AJAX be proxied using a PHP-based script?

开发者 https://www.devze.com 2023-02-04 21:59 出处:网络
I was wondering if it\'s possible开发者_Python百科 for a PHP-based proxy to handle AJAX data. I\'m trying to make one or use a ready-made script.

I was wondering if it's possible开发者_Python百科 for a PHP-based proxy to handle AJAX data. I'm trying to make one or use a ready-made script.

Thanks!


Yes.

Your client-side javascript can make an AJAX request to a same-domain server side script (e.g. PHP in this example), the PHP script could then make a request to a third-party url, process it however, and then return the result to the original client-side javascript.

If you can provide some additional detail, I, or someone else, may be able to provide a more concrete solution/explanation.

EDIT: See http://developer.yahoo.com/javascript/howto-proxy.html for an excellent explanation of the process.


AJAX Request using PHP as a proxy


AJAX data isn't different from any other kind.

0

精彩评论

暂无评论...
验证码 换一张
取 消