-3

サイトを購読するときにユーザー名を入力しようとすると、選択が拒否され、選択可能なユーザー名がいくつか表示されます。たとえば、Junaid を配置すると、サイトに Junaid1123、Junaid444 のオプションが表示されます。

4

1 に答える 1

1
1) Use javascript to get the entered username from the form.
2) Send a synchronous ajax request containing the entered username to a program on your server.
3) Have your server program check if the entered username is in your database.
3) If the entered username is not in your database, then create an array of 5 random numbers.
4) Create an array of 5 strings, where each string consists of the username added to each of the random numbers.
5) Check your db for the 5 usernames, and eliminate any that already exist.  Create more as necessary. 
6) Send back five usernames in the response.
7) Use js to display the five names to the user.
于 2013-06-09T07:04:41.973 に答える