Php generate member account _ PHP Tutorial

Source: Internet
Author: User
Php generates a member account. Generate a member account using php. the code is as follows: functionget_number ($ table, $ filed) {if (! Isset ($ table) |! Isset ($ filed) {return;} if (trim ($ table) | generate a member account using php. the code is as follows:

Function get_number ($ table, $ filed) {if (! Isset ($ table) |! Isset ($ filed) {return '';} if (trim ($ table) ='' | trim ($ filed) = '') {return '';} global $ db; $ user_number = str_shuffle (substr (randomname (-5), 11); $ SQL =" select 'id' from '". $ table. "'where '". $ filed. "'= '". $ user_number. "'"; if ($ db-> getRowsNum ($ SQL) | strpos ($ user_number, '0') = 0) {get_number ($ table, $ filed);} return $ user_number;}/*********** generate a random number. [the random number is the last five digits, 19 digits in total] ****************/function randomname ($ start, $ le N = '') {if (! Isset ($ start) |! Is_numeric ($ start) | ($ len! = ''&&! Is_numeric ($ len) {return '';} echo '-----'; $ seedstr = explode ('', microtime (), 5 ); $ seed = $ seedstr [0] * 10000; $ random = date ('ymdhis ', time ()). rand (Random, 100000); return $ len = ''? Substr ($ random, $ start): substr ($ random, $ start, $ len );}
Articles you may be interested in
  • Php generates a bar chart (Statistical Chart) program
  • In php, we use the curl post method to submit data and the get method to obtain webpage data.
  • Php idea and implementation method for generating short URLs
  • Php generates a dynamic verification code Image (gif)
  • PHP generates continuous numbers (letters) array function range () analysis, PHP lottery program function
  • Php QR code generation method summary
  • Several methods for generating random numbers using PHP
  • Php verification code generation function

Using function get_number ($ table, $ filed) {if (! Isset ($ table) |! Isset ($ filed) {return '';} if (trim ($ table) ='' |...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.