MyBB Community Forums

Full Version: Custom PHP file with the users UID.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I make a custom PHP file where I echo out the logged-in users UID?

I think I would require to call some MyBB default codes, and then I would maybe be able to call the user UID by the following or something.

echo $mybb->user['uid'];

Any ideas?
The code should be something like this;
<?php
define("IN_MYBB", 1);
require './global.php';
if($mybb->user['uid'])
{
echo "Hello, $mybb->user['username']";
}
?>