2019-05-24, 01:20 PM
What I have to do here to make it query ? I have this script test.php in public folder/test/test.php
So the path to require_once "../global.php"; is ../
So the path to require_once "../global.php"; is ../
<?php
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'test.php');
require_once "../global.php";
require_once "../inc/init.php";
require_once ('include/functions.php');
require_once ('include/MysqliDb.php');
require_once ('config.php');
global $db;
if (isset($_GET['act']) && _notEmpty($_GET['act']))
{
$action = strtolower($_GET['act']);
$db = new MysqliDb ($db_host, $db_username, $db_password, $db_name);
if (isset($_POST['username'], $_POST['password'], $_POST['uuid']))
{
$username = $_POST['username'];
$pass = $_POST['password'];
$uuid = $_POST['uuid'];
// only if isset becouse old version does not have
if (isset($_POST['ipaddress'])){
$ip = $_POST['ipaddress'];
}
$stats = array(
"uid" => NULL,
"uname" => $username,
"ip" => $ip,
"date" => NULL
);
$query = $db->insert_query("loginstats", $stats);
}
}