MyBB Community Forums

Full Version: Unwanted output from "global.php"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Yo. Cool  I'm a first-time poster, new MyBB user, and hoping I can get some assistance.

I have some PHP code that includes "global.php" and "functions_user.php". The problem is, including the former also outputs the forum's account login page.

Here is a picture of the output I'm referring to: https://puu.sh/BH4aP/137becbb0a.png

The desired goal is including the files with no output being generated, that way I'm free to use "echo" as a return/response value. Currently however, including "global.php" seemingly overwrites any "echo" calls, even those that come after the include statements.

Is there a way to stop "global.php" from automatically generating that forum page? Any other ideas that might produce a similar outcome? I have alternative ideas just in case there is no path forward with this, but being able to take this path would definitely get me from point A to point B with least resistance.

Thanks for reading.   Cool
if you are using include function then instead try using require_once ...
(2018-10-07, 11:08 AM).m. Wrote: [ -> ]if you are using include function then instead try using require_once ...
I tried that initially and got the same results.

Bump...

Based on my testing, it seems the script never gets past including "global.php". What is the deal here?

<?php
define("IN_MYBB", 1);
?>


<?php
//die("Testing... 1");
require_once("../forums/global.php");
//die("Testing... 2");
require_once('../forums/inc/functions_user.php');
//die("Testing... 3");

if(user_exists('')) {
 echo "user exists!";
}

echo "fff";

?>