2017-07-01, 05:38 PM
so im trying to create an external login for my Software. If the login is correct its echo 1 and if its incorrect it echo 0 but at the moment its just echo 1 Even if the login data is incorrect..
(i am new at php)
This is my Code:
https://example.com/login.php?action=log...d=PASSWORD
i used the MyBBIntegrator
i hope someone can help me and sorry for the bad english, im german.
(i am new at php)
This is my Code:
<?php
define('IN_MYBB', NULL);
global $mybb, $lang, $query, $db, $cache, $plugins, $displaygroupfields;
require_once 'global.php';
require_once 'MyBBIntegrator.php';
$MyBBI = new MyBBIntegrator($mybb, $db, $cache, $plugins, $lang, $config);
$action = $_GET['action'];
$username = ($_GET['username']);
$password = ($_GET['password']);
if(!$action)
{
echo "Please enter an action.";
}
else
{
if($action == "login")
{
$login_status = $MyBBI->login($username, $password);
if ($login_status == true)
{
echo "1";
}
else
{
echo "0";
}
}
else
{
echo "Invalid action.";
}
}
?>
So you log in: https://example.com/login.php?action=log...d=PASSWORD
i used the MyBBIntegrator
i hope someone can help me and sorry for the bad english, im german.