2016-01-30, 03:59 PM
Hi I switched over from e107 to mybb and I run a App that my members login into to use , there login needs to match there username and password that they register at mybb forum.
can you please help me here I have tryed several things but nothing works and im not a php coder so yes Im asking you to please ( fix or rewrite the code below ) Thanks
My App Is looking for $username and $passwd
--------------------------Old Code That ( Worked ) With Old Forum e107 with just MD5-----------------------------
$passhash = md5( $passwd );
$authresult = mysql_query("SELECT user_name,user_password, from dbt WHERE user_name='$username' AND user_password='$passhash' ")
or die('mysql error: ' . mysql_error() );
// echo $passwd;
if (mysql_numrows($authresult)==0)
--------I Cant Get This To Work On new Forum mybb With MD5 And Salt------------
-------------------------------------I tryed all This----------------------------------
$passhash = md5($passwd . $salt);
// $passhash = md5($password . $salt);
//$passhash = md5($passwd), $username('salt'));
//$passhash = md5($password), $username('salt'));
//$passhash = md5(md5($salt).md5($passwd));
// $passhash = md5(md5($salt).md5($password));
// $passhash = md5($salt('password'))
// $passhash = md5($salt('passwd'))
//$passhash = md5(md5($salt).md5($plain_pass));
$authresult = mysql_query("SELECT username,password,salt from mybb_users WHERE username='$username' , password And salt='$passhash' ")
or die('mysql error: ' . mysql_error() );
echo $passwd;
if (mysql_numrows($authresult)==0)
-------------------------------------I tryed This----------------------------------
define("IN_MYBB", 1);
if($mybb->input['action'] == "login")
{
$authresult = $db->simple_select("users", "password, salt", "username = '" . $db->escape_string($mybb->input['username']) . "'");
$user = $db->fetch_array($authresult);
if(md5(md5($user['salt']) . md5($mybb->input['password'])) == $user['password'])
{
echo $passwd;
if (mysql_numrows($authresult)==0)
-------------------------------------I tryed This----------------------------------
function mybb_validate($passwd)
{
$authresult = mysql_query("SELECT username,password,salt from mybb_users WHERE username='$username' AND password,salt='$passwd' ")
or die('mysql error: ' . mysql_error() );
if($username['password'] == md5(md5($username['salt']).$passwd))
{
return true;
}
return false;
}
echo $passwd;
if (mysql_numrows($authresult)==0)
can you please help me here I have tryed several things but nothing works and im not a php coder so yes Im asking you to please ( fix or rewrite the code below ) Thanks
My App Is looking for $username and $passwd
--------------------------Old Code That ( Worked ) With Old Forum e107 with just MD5-----------------------------
$passhash = md5( $passwd );
$authresult = mysql_query("SELECT user_name,user_password, from dbt WHERE user_name='$username' AND user_password='$passhash' ")
or die('mysql error: ' . mysql_error() );
// echo $passwd;
if (mysql_numrows($authresult)==0)
--------I Cant Get This To Work On new Forum mybb With MD5 And Salt------------
-------------------------------------I tryed all This----------------------------------
$passhash = md5($passwd . $salt);
// $passhash = md5($password . $salt);
//$passhash = md5($passwd), $username('salt'));
//$passhash = md5($password), $username('salt'));
//$passhash = md5(md5($salt).md5($passwd));
// $passhash = md5(md5($salt).md5($password));
// $passhash = md5($salt('password'))
// $passhash = md5($salt('passwd'))
//$passhash = md5(md5($salt).md5($plain_pass));
$authresult = mysql_query("SELECT username,password,salt from mybb_users WHERE username='$username' , password And salt='$passhash' ")
or die('mysql error: ' . mysql_error() );
echo $passwd;
if (mysql_numrows($authresult)==0)
-------------------------------------I tryed This----------------------------------
define("IN_MYBB", 1);
if($mybb->input['action'] == "login")
{
$authresult = $db->simple_select("users", "password, salt", "username = '" . $db->escape_string($mybb->input['username']) . "'");
$user = $db->fetch_array($authresult);
if(md5(md5($user['salt']) . md5($mybb->input['password'])) == $user['password'])
{
echo $passwd;
if (mysql_numrows($authresult)==0)
-------------------------------------I tryed This----------------------------------
function mybb_validate($passwd)
{
$authresult = mysql_query("SELECT username,password,salt from mybb_users WHERE username='$username' AND password,salt='$passwd' ")
or die('mysql error: ' . mysql_error() );
if($username['password'] == md5(md5($username['salt']).$passwd))
{
return true;
}
return false;
}
echo $passwd;
if (mysql_numrows($authresult)==0)