我正在制作一个自定义 joomla 帐户创建脚本,该脚本还会生成一个随机密码,并通过邮件发送给用户。帐户已创建,但密码始终无效。
我已经捕获了用户、电子邮件等。
$password = rand(1000,99999);
$password2 = md5($password);
$query = "INSERT INTO jos_users (username,email,name,usertype,sendEmail,gid,params,registerDate,password)
VALUES (' $username','$email','$name','Registered','1','18','admin_language=
language=
editor=
helpsite=
timezone=0',NOW(),'$password2')";
$result = mysql_query($query);
$uid=mysql_insert_id();
等…………等
我已经尝试过这些变化
sha1($_POST['pword']);
和
$password = rand(1000,9999);
$salt = md5(rand(1000,9999));
$password2 = md5($password.$salt).":".$salt;
仍然当我发送用户 $password 时它是错误的并且无法登录。我能错过什么吗?
/////////////////////////////full script just in case///////////////////////////////
$password = rand(1000,99999);
$password2 = md5($password);
die($password2);
$query = "INSERT INTO jos_users (username,email,name,usertype,sendEmail,gid,params,registerDate,password)
VALUES (' $username','$email','$name','Registered','1','18','admin_language=
language=
editor=
helpsite=
timezone=0',NOW(),'$password2')";
$result = mysql_query($query);
$uid=mysql_insert_id();
$query = "INSERT INTO #__spcClient (clientID,GSM,StartingUnits,Units) VALUES ('$uid','$GSM','$units','$units')";
$myfunctions->dbquery($query);
$query = "INSERT INTO jos_core_acl_aro (section_value,value,name) VALUES ('users','$uid','$name')";
$result = mysql_query($query);
$uid2=mysql_insert_id();
//$rowcount = $db->getAffectedRows($result);
$query = "INSERT INTO jos_core_acl_groups_aro_map (group_id,aro_id) VALUES ('18','".$uid2."')";
$result = mysql_query($query);
////////////////////////////////////////