grantus
Active member
I'm trying to get user info on my own PHP page and I looked around and saw a few examples but I can't get it to work.
I have this:
I get a blank page and this is the error:
I need to be able to grab their user_id, username, and maybe a few other variables.
What could be causing the error?
Thanks.
I have this:
Code:
<?php
$fileDir = $_SERVER["DOCUMENT_ROOT"];
if ( ! file_exists( $fileDir . '/src/XF.php' ) ) {
return false;
}
require( $fileDir . '/src/XF.php' );
\XF::start($fileDir);
$app = \XF::setupApp('XF\Pub\App');
$app->start();
$visitor = \XF::visitor();
$user_id = $visitor['user_id'];
echo 'user_id: '.$user_id;
I get a blank page and this is the error:
Code:
ErrorException: Fatal Error: Cannot redeclare class XF - src/XF.php:7
I need to be able to grab their user_id, username, and maybe a few other variables.
What could be causing the error?
Thanks.