最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

database - Change user_nickname for author page link

programmeradmin2浏览0评论

I have a page where user can change their personal info. Now I want to give them a possibility to change their personal page link by changing theire user nickname. So I want to create simple form with two fields and one button. This form will change this column in this table:

<form role="form" name="profile_name_form" id="profile_name_form" action="#">

<label>Name</label>
<input type="text" name="user_nicename" id="user_nicename" />

<label>Pin</label>
<input type="text" name="pin_code" id="pin_code" />

<div id="update_message"></div>
<button type="button" onclick="update_profile_name();">Update</button>

</form>

Firts field for nickname and second field for checking pin-code. So, user can change his nicname only if he know personal pin. I have another database "DB_test" with table "list" where only two columns: "profile_id" and "pin".

So if user will put correct username and pin-code to his profile form it will update "user_nicname" in WP database.

Example:

Short Questions:

  1. How to update "user_nicname" in "wp_users" table? It acan be the simple example, only important part of jQuery.ajax with response messages and other functions of this form.
  2. How to verify username and pin-code from a separate database? or a table inside current website if it will be faster and easier?

Thanks a lot for any helpful information!

发布评论

评论列表(0)

  1. 暂无评论