PDA

View Full Version : Netscape & Who's Online


11-07-2000, 02:22 PM
I used a whosonline hack I found in this forum to create a remote message which reads "There Are Currently xx Members and xx Guests Online" that I would like to place on my .shtml homepage. I tried calling the file via an SSI command <!--#include virtual="/forums/online.php3"-->.

It works great in IE, but returns an error in Netscape. Any clue why? The test page is at http://www.babyuniversity.com/test/php_test.shtml.

The content of the online.php3 file is


<?php
chdir($DOCUMENT_ROOT . "/forums");
require($DOCUMENT_ROOT . "/forums/global.php3");

$loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid=0");
$guests=$loggedins[sessions];
$loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid<>0");
$members=$loggedins[sessions];

echo "There are currently $members forum members and
$guests guests online. <a href=/forums/index.php3>Join us!</a>";

?>

Thanks!

11-07-2000, 02:28 PM
I get this error in IE:

Warning: Oops, php3_SetCookie called after header has been sent in /home/babyu/babyuniversity-www/forums/global.php3 on line 754

Warning: Oops, php3_SetCookie called after header has been sent in /home/babyu/babyuniversity-www/forums/global.php3 on line 757

Maybe that's cos i'm not registered...

btw the link you posted doesn't work. This one works for me:
http://www.babyuniversity.com/test/php_test.shtml (without the dot at the end :))

11-07-2000, 02:37 PM
That's the same error I get with Netscape, although I don't have any problem with IE. Any ideas?

11-08-2000, 09:42 AM
I now know that the error that is returned to me has to do with cookies and being logged in and is not exclusive to Netscape.

If you are logged in, you do not see an error, simply the number of members and guests online. Doesn't matter if it is Netscape or IE.

However, if you are not a logged in member, it precedes the # of members with the following error:

---------------------------------------------------------------------
Warning: Oops, php3_SetCookie called after header has been sent in /home/babyu/babyuniversity-www/forums/global.php3 on line 754

Warning: Oops, php3_SetCookie called after header has been sent in /home/babyu/babyuniversity-www/forums/global.php3 on line 757
---------------------------------------------------------------------

The correct URL to view an example is http://www.babyuniversity.com/test/php_test.shtml

Thanks for any ideas or suggestions!

11-08-2000, 04:44 PM
FYI - after spending several hours digging through the posts, I finally found the answer I needed.

It appears that I had a carriage return at the very beginning of the php file.

I learned a very valuable lesson today! LOL