Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 07-24-2000
Last Update: Never
Installs: 0
No support by the author.
Hi,
I called from an external page (still on the same domain / same site) some vbulletin features such as member numbers, last member registered....
And on I got an error message on the very top of the brower page. It strange, because I don't have myself this error, it seems only non registered member got this message.
Here is the code I included:
1) To call the script features (just below the html body tag):
Quote:
<? require("/domain/www/community/global.php");
$numbersmembers=$DB_site->query_first("SELECT COUNT(userid) AS users FROM user");
$numbermembers=$numbersmembers[users];
$getnewestusers=$DB_site->query_first("SELECT username,userid FROM user ORDER BY userid DESC LIMIT 1");
$newusername=$getnewestusers[username];
$newuserid=$getnewestusers[userid];
$countposts=$DB_site->query_first("SELECT COUNT(postid) AS posts FROM post");
$totalposts=$countposts[posts]; ?>
And to display all these features, somewhere else in the page:
Quote:
<?PHP echo "$numbermembers"; ?> members are registered, and <?PHP echo "$totalposts"; ?> messages were posted in total. Welcome to our newest member: <?PHP echo "$newusername"; ?>.?
And here is the error message:
Warning: Oops, php3_SetCookie called after header has been sent in /xpk_hq/www/community/global.php on line 712
It works pefectly, it just display this ugly message on top.
Why is a cookie involved here ? Could this be the problem ?
Please help me,
Thanks,
Benj
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I tried using your same code (changing the path to the correct one on my server) and it gets errors trying to find the admin/config.php
It appears it's trying to still find it from the directory where I have the file calling the script from.
So I have this:
page that has your code: /path/through/server/test/test.html
pointing the require call to: /path/through/server/test/boards/gobal.php
but due to the global.php looking for admin/config.php I get an error of:
Quote:
Warning: Failed opening 'admin/config.php' for inclusion (include_path='') in boards/global.php on line 36
cause it seems that it is looking for test/admin/config.php which of course does not exist
Any thoughts on how to get around that problem? Or do I have to put my non-vb page inside the boards folder with the other vb pages to make it work?