Copy codeThe Code is as follows:
<?
// Author: www.tongqiong.com
// Header ("content-type: text/html; charset = UTF-8 ");
// Include_once ("include/config. php ");
// Include_once ("include/db_mysql.inc.php ");
/// Include_once ("include/n_public_function.php ");
// $ Db = new DB_MYSQL ("localhost", "dbh218710", "root", "123 ");
Include_once ('./common. php ');
Include_once (S_ROOT. './data/data_magic.php ');
?>
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> </title>
</Head>
<Body>
<?
Global $ _ SGLOBAL; // defines global variables.
// Registered User Name
$ Rando_first_name = array (
'Where to shop ',
'Same as the poor BBS ',
'Taizhou mame ',
'1970 hackers'
);
// Registered Password
$ Rando_first_password = array (
'15032x ',
'123 ',
'123 ',
'1ggg17'
);
/* To ensure that the user name and password can match the upper number, the array length of the output characters is compared.
Echo count ($ rando_first_name );
Echo "______";
Echo count ($ rando_first_password );
Exit;
*/
For ($ I = 0; $ I <count ($ rando_first_name); $ I ++ ){
$ Username = $ rando_first_name [$ I];
$ Pwd1 = $ rando_first_password [$ I];
$ Salt = substr (uniqid (rand (),-6 );
$ Pwd = md5 (md5 ($ pwd1). $ salt );
// Query whether the user name already exists
$ SQL _username = "select username from uc_members where username = '". $ username ."'";
$ S_name = $ _ SGLOBAL ['db']-> fetch_array ($ _ SGLOBAL ['db']-> query ($ SQL _username ));
// If the user with the same name does not exist
If ($ username! = $ S_name ['username']) {// if it does not exist
$ _ SGLOBAL ['db']-> query ("insert into uc_members (username, password, regdate, salt)
VALUES ('$ username',' $ pwd', '". mktime ()."', '$ salt ')");
$ SQL = "select uid from uc_members where username = '". $ username ."'";
$ _ SGLOBAL ['db']-> query ($ SQL );
$ Uuu = $ _ SGLOBAL ['db']-> fetch_array ($ _ SGLOBAL ['db']-> query ($ SQL ));
Echo $ uuu ['uid'];
$ _ SGLOBAL ['db']-> query ("insert into uc_memberfields (uid)
VALUES ('". $ uuu ['uid']."') ");
Echo $ username. "success <br/> ";
} Else {
Echo "the user you want to add has been added! ";
}
}
// Author: www.tongqiong.com
?>
</Body>
</Html>