drhgzx4727 2014-10-11 14:25
浏览 87

Facebook通过PHP登录

While I am running the html code using below code, the login is happening successfully.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html> 
<head> 
<script language="JavaScript" type="text/javascript"> 
  function loginpage_onload() { 
    document.forms[0].submit(); 
  }

</script> 
</head> 
<body onload="loginpage_onload();"> 
<form action="https://www.facebook.com/login.php" method="post"> 
<input type="hidden" name="lsd" value="cdfvrtg" autocomplete="off" />
<input type="hidden" name="email" id="email" value="mymail.com"/>
<input type="password" name="pass" id="pass" class="inputpassword" value="mypass" tabindex="1"/>
</form> 
</body> 
</html>

but, when I am copying the same thing in a .php page and running the php, its not happening. Prompt: "For your security, never enter your Facebook password on sites not located on Facebook.com"

Why it's working in .html and not in .php?

  • 写回答

1条回答 默认 最新

  • du521521521 2014-10-11 14:49
    关注

    What you're trying to do, in its current form, poses a security risk to end users of both Facebook and your website, and is therefore prohibited.

    It's much more likely that you have a legitimate reason to let your users securely login to Facebook from your website. In this case, check out the Facebook Login documentation for their Javascript SDK for a push in the right direction.

    To elaborate on why it's prohibited, Facebook won't accept a form submit from any other domain to prevent phishing attacks and other nasties.

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!