duannengling4705 2012-04-07 23:33
浏览 41
已采纳

通过身份验证从外部网站提取内容。

I'm currently trying to create a php script were the user has the ability to connect their user to several pages.

That was the idea.

What i'm trying to to is to check if the user is logged in to battlelog, and then grab his username.

I'm not sure if it's even possible... But i would appreciate any help I can get!

  • 写回答

2条回答 默认 最新

  • duandingyou3331 2012-04-07 23:38
    关注

    The main problem you're going to run into here is that most modern browsers employ cross-domain security to make sure that other websites or potentially malicious websites cannot gain illegal access to the user data in another browser window.

    What you're hoping to accomplish is what's called cross-site scripting. It is possible under certain circumstances. For instance, if battlelog exposes an API for another developer to access user data.

    This would of course involve server-side requests cross-domain, so you'd either need to use your server as a proxy, or use a JSONP web service where the response is sent in JSON format wrapped in a callback function.

    Accessing Data From PHP Scripts:

    Since you're using PHP, you'd need to have access to an API. PHP scripts cannot make requests to a browser, so battlelog would either need to have a plug-in architecture where you can embed scripts in their website, or they would need to expose an API for you to query from your server.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)