2011-09-06 121 views
1

我试图做一些验证,以Facebook Registration PluginFacebook,如何验证注册表单?

我使用此代码:

<?php 
$fields = json_encode(array(
array('name' => 'name'), 
array('name' => 'first_name'), 
array('name' => 'last_name'), 
array('name' => 'birthday'), 
array('name' => 'email'), 
array('name' => 'address', 'description' => 'Address', 'type' => 'text'), 
array('name' => 'zipcode', 'description' => 'Zip Code', 'type' => 'text'), 
array('name' => 'phone', 'description' => 'Phone Number', 'type' => 'text') 
)); 

?> 
<div style="display: none;"> 
    <div id="reg_istration" style="width:640px;height:auto;overflow:auto;"> 
    <iframe class="facebook-login" src="http://www.facebook.com/plugins/registration.php? 
     client_id=153230661424821& 
     redirect_uri=http://www.xxx.com/xxx.php?& 
     fields=<?php echo urlencode($fields);?>" 
    scrolling="auto" 
    frameborder="no" 
    style="border:none" 
    allowTransparency="true" 
    width="100%" 
    height="330"> 
    </iframe> 
    </div> 
</div> 

林不知道如何将validation代码适用于该代码。

有什么想法?

谢谢

回答

2

尝试使用插件的XFMBL版本。

Registration Advanced Uses页:

如果你想在注册过程中验证添加到任何领域,你必须使用插件的XFBML版本,因为iframe中不能做跨域通信。