Reply
Old 02-04-2004, 02:59 PM PHP chatroom...help!
Filmgirl's Avatar
Super Talker

Posts: 102
Location: Orlando Florida
Trades: 0
I just set up an PHP chatroom on my site http://www.lana-clark.com

and I want to put the Who's Online set up onto the main page, but I have no idea what the hell the READ ME is saying...

I mean the first step:

Add this line at the beginning of a PHP file

What PHP file?!

Anyway, here's what the READ ME said, someone put it into english terms....thanks!:

Quote:
WHO'S ONLINE?

Here you have some instructions how to print
a list of the users online on any page of your site.

1. Add this line at the beginning of a PHP file:

<?php $pth='xxx';include "$pth/incl/users.inc"; ?>

where 'xxx' should be a correct relative path to your chat directory.
If you'd like to print the list on your main page - http://your-site.com/index.php ,
and the chat lives in a directory: http://your-site.com/friends/simple-chat/ ,
you should set $pth='friends/simple-chat';

2. Call the function whos_online(); using one argument which would separate the users.
<?php whos_online('<br>'); ?>


The following lines are a simple example of http://your-site.com/index.php


--- INDEX.PHP starts here ---


<?php $pth='friends/simple-chat';include "$pth/incl/users.inc"; ?>

<html><head>
<title>MY MAIN PAGE</title>
</head><body>


<!-- who's online list in a row -->
<div style="background-color:#cccccc">
<?php whos_online(''); ?>
</div><br>


<!-- who's online list in a column -->
<div style="background-color:#aaaaaa">
<?php whos_online('<br>'); ?>
</div><br>


</body></html>


--- INDEX.PHP ends here ---
Filmgirl is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 02-04-2004, 05:50 PM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Trades: 0
Hey Filmgirl,

When they say PHP file they mean - yourpage.php

In order to have the whos_online() function to work, it needs to be in a .php file.

You can just take your .html page and change the extension to .php and then you have a .php page

Once you have done that just take the code they show you and put it into your page.
__________________
CYTech-services.com - 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
Reply     « Reply to PHP chatroom...help!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11729 seconds with 13 queries