2007-03-05, 09:00 PM
I tried to make a script registration for my site then can be use at myBB Board but when i try to login into forum myBB was denied or like username & password not in database..just like not accepted by myBB .Can u resolve or gimme a solution ??
this code i put on registration.php :
this code i put on registration.php :
...
// .. i cut need to show
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$epass = strip_tags($_POST['pwd']);
error_reporting(E_ALL & ~E_NOTICE);
require_once 'forum/inc/class_core.php';
$mybb = new MyBB;
require_once 'forum/inc/config.php';
require_once 'forum/inc/class_timers.php';
require_once 'forum/inc/functions.php';
require_once 'forum/admin/adminfunctions.php';
require_once 'forum/inc/class_xml.php';
require_once 'forum/inc/functions_user.php';
require_once 'forum/inc/class_language.php';
require_once "forum/inc/db_mysql.php";
require_once 'forum/inc/settings.php';
$mybb->settings = &$settings;
$db = new databaseEngine;
$db->connect('localhost', 'xxx', 'xxx');
$db->select_db('forum');
$now = time();
$salt = random_str();
$loginkey = generate_loginkey();
$saltedpw = md5(md5($salt).md5('$epass'));
$newuser = array(
'username' => "$name",
'password' => $saltedpw,
'salt' => $salt,
'loginkey' => $loginkey,
'email' => "$email",
'usergroup' => 2,
'regdate' => $now,
'lastactive' => $now,
'lastvisit' => $now,
'website' => '',
'icq' => '',
'aim' => '',
'yahoo' => '',
'msn' =>'',
'birthday' => '',
'signature' => '',
'allownotices' => 'yes',
'hideemail' => 'no',
'emailnotify' => 'no',
'receivepms' => 'yes',
'pmpopup' => 'yes',
'pmnotify' => 'yes',
'remember' => 'yes',
'showsigs' => 'yes',
'showavatars' => 'yes',
'showquickreply' => 'yes',
'invisible' => 'no',
'style' => '0',
'timezone' => 0,
'dst' => 'no',
'threadmode' => '',
'daysprune' => 0,
'regip' => "$lastip",
'language' => '',
'showcodebuttons' => 1,
'tpp' => 0,
'ppp' => 0,
'referrer' => 0,
'buddylist' => '',
'ignorelist' => '',
'pmfolders' => '',
'notepad' => ''
);
$db->insert_query('mybb_users', $newuser);
$uid = $db->insert_id();
print "<br><br><hr>Registration Complete<br>";
print "You account has active ,thanks for join whit us!<hr>";