简单的跨域php脚本
我正在寻找一个简单的脚本,我可以在其中执行类似的
$.getScript('fetcher.php?url=' + escape('http://www.google.com') + '&callback=console.log');
操作响应应该是一个很长的一行,如下所示:
console.log({responseText: '<!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title><script>windo...'})
它不应该超过10行代码,并且没有它还不存在。
我在 XAMPP 中使用 php,只是用它来构建数据库,所以我不需要包含任何装饰(不包含 get 与 post,不包含数据),只需 file_get_contents
和 $_GET
。当然我还是想对url进行编码
I'm looking for a simple script in which I can do something like this
$.getScript('fetcher.php?url=' + escape('http://www.google.com') + '&callback=console.log');
The response should be one really long line that looks like this:
console.log({responseText: '<!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title><script>windo...'})
It shouldn't be more than 10 lines of code and there's no way it doesn't already exist.
I'm using php in XAMPP and am just using it to build a database so I don't need any frills included (no get vs post, no data included) just file_get_contents
and $_GET
. Of course I would still like to encoded the url
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个怎么样,更新了
How about this , updated
fetcher.php
javascript
fetcher.php
javascript