Just put the php into the UCenter directory and execute it. Source:
http://www.tongqiong.com/read.php?tid-27-ds-1.html
- //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');
- ?>
-
-
- global $_SGLOBAL;//Define global variables
- //Registered user name
- $rando_first_name = array(
- 'Where to shop',
- 'Tongqiong Forum',
- 'Taizhou Mom',
- '7788 Hacker '
-
- );
-
-
- //Registered password
- $rando_first_password = array(
- '15032x',
- '103716',
- '114517',
- '1ggg17'
- );
-
-
-
- /* ensure user The name and password can be compared with the last number and the array length of the output words
- echo count($rando_first_name);
- echo "______";
- echo count($rando_first_password);
- exit;
-
- */
-
-
- for($ i=0;$i $username = $rando_first_name[$i];
- $pwd1 = $rando_first_password[$i];
-
- $salt = substr(uniqid(rand( )), -6);
- $pwd = md5(md5($pwd1).$salt);
-
-
-
- //Query whether this username already exists
- $sql_username = "select username from uc_members where username='" .$username."'";
- $s_name = $_SGLOBAL['db']->fetch_array($_SGLOBAL['db']->query($sql_username));
-
- //If there is no duplicate name User
- 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
";
- }else{
- echo "The user you want to add has been added! ";
- }
- }
-
- //Author: www.tongqiong.com
- ?>
-
-
Copy code
|