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.

    评论

报告相同问题?

悬赏问题

  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办