2009-10-22, 07:47 AM
Hi there,
Actually I'm triying to implement a mybb registration in my homepage. I can create new users but if I try to login with them it always said
I'm wondering what is wrong.. Here is my code for the registration (only the important parts):
Have I missed something ? Hope someone could help me
Regards Red~
Actually I'm triying to implement a mybb registration in my homepage. I can create new users but if I try to login with them it always said
Quote:Please correct the following errors before continuing:
* You have entered an invalid username or password combination.
I'm wondering what is wrong.. Here is my code for the registration (only the important parts):
<?php
function random_str($length="8") {
$set = array("a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J","k","K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T","u","U","v","V","w","W","x","X","y","Y","z","Z","1","2","3","4","5","6","7","8","9");
$str = '';
for($i = 1; $i <= $length; ++$i) {
$ch = mt_rand(0, count($set)-1);
$str .= $set[$ch];
}
return $str;
}
include("inc/connection.php");
$salt = random_str(8);
$login_key = random_str(50);
$pass = md5(md5($salt).$apw1);
$fcrisql = "INSERT INTO `forumtest`.`users` (`username`, `password`, `salt`, `loginkey`, `email`, `postnum`, `avatar`, `avatardimensions`, `avatartype`, `usergroup`, `additionalgroups`, `displaygroup`, `usertitle`, `regdate`, `lastactive`, `lastvisit`, `lastpost`, `website`, `icq`, `aim`, `yahoo`, `msn`, `birthday`, `birthdayprivacy`, `signature`, `allownotices`, `hideemail`, `subscriptionmethod`, `invisible`, `receivepms`, `pmnotice`, `pmnotify`, `remember`, `threadmode`, `showsigs`, `showavatars`, `showquickreply`, `showredirect`, `ppp`, `tpp`, `daysprune`, `dateformat`, `timeformat`, `timezone`, `dst`, `dstcorrection`, `buddylist`, `ignorelist`, `style`, `away`, `awaydate`, `returndate`, `awayreason`, `pmfolders`, `notepad`, `referrer`, `reputation`, `regip`, `lastip`, `longregip`, `longlastip`, `language`, `timeonline`, `showcodebuttons`, `totalpms`, `unreadpms`, `warningpoints`, `moderateposts`, `moderationtime`, `suspendposting`, `suspensiontime`, `coppauser`, `classicpostbit`, `loginattempts`, `failedlogin`, `akismetstopped`, `developer`)
VALUES ('$fname', '$pass', '$salt', '$login_key', '$amail1', '0', '', '', '0', '2', '', '0', '', 'NOW()', '0', '0', '0', '', '', '', '', '', '', 'all', '', '0', '0', '0', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '', '', '', '0', '0', '', '', '0', '0', '0', '', '', '1**Inbox$%%$2**Sent Items$%%$3**Drafts$%%$4**Trash Can', '', '0', '0', '', '', '0', '0', '', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0')";
$fcrinsert = mysql_query($fcrisql) or die("Can't create User: " . mysql_error());
mysql_close($connect);
?>
Have I missed something ? Hope someone could help me
Regards Red~