2016-05-21 34 views
0

我想为WordPress的最终成员插件创建php restful api。请帮助我。请建议我使用json用户api和json API插件的帮助来登录和注册的确切程序。现在我已经安装了它并使用此URL来注册。json api和json用户api插件无法正常工作

https://www.example.com/api/get_nonce/?controller=user&method=register

并将这种响应

 {"status":"ok","controller":"user","method":"register","nonce":"5f1040eaf8"} 

,但它不是存储到数据库中。你能告诉我为什么它发生了吗?

+0

对于密码,有看看PHP [密码API](http://php.net/password)。除此之外,我认为你的问题太广泛了。 –

+0

@JonStirling实际上,我也使用JSON用户api插件和getnonce来验证url请求,但它唯一产生的nonce和不存储数据到数据库.. –

+0

为json用户api。我正在使用此网址注册https://www.nuvemsonora.com/api/get_nonce/?controller=user&method=register –

回答

0

你做它的第一步,正确的方法..

你得到了nonce值,你现在可以把它传递给注册URL并提供所需的信息:

http://example.com/api/user/register/?insecure=cool" + 
            "&username=" + username + "&user_pass=" + password + 
            "&first_name=" + firstname + "&last_name=" + lastname + 
            "&email=" + email + 
            "&nonce=" + nonce + 
            "&display_name=" + displayName