UCenter batch add users php
Release: 2016-07-25 09:06:35
Original
1126 people have browsed it
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
|
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31