ageurtse
12-23-2009, 05:00 PM
Why does the code below not work.
when i put echo 'start '. $vbcheck['userid'].' end <br>' outside the function and in the head part it works. but in the function i can't get it to work.
why is this not working, and how can i get it to work.
<?php
$curdir = getcwd ();
chdir('C:/UsbWebserver/Root');
require_once('C:/UsbWebserver/Root/global.php');
chdir('C:/UsbWebserver/Root/chat');
$vbcheck = $vbulletin->userinfo;
?>
<?php
// Returns an array of user details, or false depending on whether user's cookies are valid.
function usercheck()
{
echo 'start '. $vbcheck['userid'].' end <br>';
}
?>
when i put echo 'start '. $vbcheck['userid'].' end <br>' outside the function and in the head part it works. but in the function i can't get it to work.
why is this not working, and how can i get it to work.
<?php
$curdir = getcwd ();
chdir('C:/UsbWebserver/Root');
require_once('C:/UsbWebserver/Root/global.php');
chdir('C:/UsbWebserver/Root/chat');
$vbcheck = $vbulletin->userinfo;
?>
<?php
// Returns an array of user details, or false depending on whether user's cookies are valid.
function usercheck()
{
echo 'start '. $vbcheck['userid'].' end <br>';
}
?>