2016-05-21 23 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