简体   繁体   English

如何在Facebook注册插件中设置字段?

[英]How do I set the fields in the facebook registration plugin?

I have the facebook registration plugin on the site and I'm correctly parsing the signed request from facebook. 我在网站上有Facebook注册插件,并且我正在正确解析来自Facebook的签名请求。 However, I want to set the fields with the data I've just received when the page reloads so all the fields are not blank. 但是,我想用重新加载页面时刚收到的数据来设置字段,所以所有字段都不为空。 How do I access these fields to set them? 如何访问这些字段进行设置? From reading the documentation, I noticed that there is a variable called 'form' that gets passed to a function if the onvalidate field is specified in the facebook registration plugin. 通过阅读文档,我注意到,如果在facebook注册插件中指定了onvalidate字段,则有一个名为“ form”的变量会传递给函数。

However, this is only effective on submit, not on page load so I can't really use that. 但是,这仅对提交有效,对页面加载无效,因此我不能真正使用它。 Is there any other method of setting the registration fields? 还有其他设置注册字段的方法吗?

Just use the PHP array function to request what you want pulled out of the info that gets sent. 只需使用PHP数组函数来请求要从发送的信息中提取的内容。 For example 例如

if you want the users email it would be 如果您希望用户发送电子邮件,它将是

$email = $response["registration"]["email"];

If you want custom fields then you'll need to read the documentation and add the custom fields into the &fields section of the registraton page. 如果需要自定义字段,则需要阅读文档并将自定义字段添加到注册页面的&fields部分。 Don't forget to define them in your callback url though! 不过,不要忘记在回调URL中定义它们!

PS if you can answer my question now that'd be great ;) (http://stackoverflow.com/questions/9405647/facebook-registration-connect) PS,如果您现在可以回答我的问题,那就太好了;)(http://stackoverflow.com/questions/9405647/facebook-registration-connect)

-Brad -布拉德

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM