First off, I've decided to hold off on finding a way to restrict file size and/or dimensions in my BB and chat.

Ah, ha .. but a new challenge arises. I'd like to have a function whereas to create a 'Whos On' function that will ultimately, well, tell who's on .. ie logged into chat or the board.

All fine and dandy. Upon login, their user name is appended to a list (in pretty markup) and displayed in a small browser window (via javascript of course) that can be accessed through a hyperlink (again, most likely saying "Who's On!").

I can do that.

What I don't know how to do is erase their name from the list if their browser closes suddenly (or if they change the URL or hit a bookmark).

Now, I have a "Log Off" button and if they would be nice enough to hit that every time they left, there'd be no problem. But you know browsers these days .. no respect for staying stable -- they crash as often as Bill Clinton gets new cigars.

I too had the same problem when I wrote my chat thingy(That I never actualy finished). I delt with it in two ways. First to try and keep it as up to date as possible I used a JavaScript onUnload and onLoad event to place there name in the file and to take them out. And then like you said computers crash, browsers crash (especialy on Windows)etc.. So I ended up time stamping the names and setting a timeout for how long they would remain there between posts. So when someone posts one of the many things the script did was update the posters time stamp. I would recomend you use DB_File for the database of names and time stamps. Then when someone would click on the "Who's On" link the script would go through the database for that chat room and delete old entries ( I set the limit on 1 hour) then display what was left.

Well my method was a little lame but It should give you an idea. With a little research I am sure you could come up with something better. I used a small pop-up window that called a Perl Script to delete the name. The Perl script then returned a simple page that said Welcome or Goodbye and had a simple JavaScript in it to close it's self.(self.close) Here is the JavaScript that called the pop-up <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

Well something has got to execute the Script somehow before the browser closes. This was the only method I could come up with. Of coarse you could just stick to the times between posts and perhaps make the time out 15 minutes. There is really no accurate way I know of to do this. I guess that is why everyone is using IRC or Java

Ever seen WBS (before it was closed down by GO Networks)? Their chat system was CGI/JavaScript/HTML and had a nice Who's On function. They didn't use timestamping methods because you could 'lurk' (hand out in the background not posting) for hours at a time .. but the list was accurate up to five minutes either way.

Well, I still appreciate all your thoughts on this -- if I luck (and I do mean luck) into a solution, I'll let you know here, okay?

I was thinking about your problem today and I think I came up with a possible solution that is better than what we discussed so far. You could use a hidden frame that reloads every 5 minutes. You don't even need JavaScript for this. Just print a refreash header with the Perl script the frame calles. Have the same Script that prints the refreash header update a database with the users name and a time stamp. Now when someone click on "Who's On" you can be accurate up to five minutes. Anyone with a time stame that is over five minutes old you just delete and display the rest. In all browsers I have worked with refreashing a hidden frame is not even noticable.

Still the timestamping and removing from the list those who do not post within five minute intervals, does not keep the list as accurate as I would like. The list would only show those who have recently (within five minutes) logged on.

Ah, ha! But fret not -- I do not walk away from our nice discussion without anything. Your hidden frame suggestion has sparked an idea in this noggin o' mine.

in the hidden frame I may be able to get the script to execute the 'erase' of that user's name if the browser closes (via voluntary exit {bookmark, new location} or involuntary {browser illegal operation or OS crash/freeze}).

Actually, I haven't thought this out. It's too early and I am at work.

See anything I am missing in my thought process? Logically, doesn't it at least -sound- like a valid idea?

There is no way with JavaScript to do anything after a browser crashes or OS crashes or the user just disconnects from the Internet. JavaScript is not ran by the server it is ran by the Browser.

I think you misunderstood what I was trying to say. If a frame refreshes every five minutes and that frame calles a script for each refresh your timestamp will be accurate to within 5 or 6 minutes. So if a timestamp is over 6 minutes old it must mean the browser crashed or user disconnected etc.. The user posting messages to the chat room will have nothing to do with the timestamp. The timestamp would be generated from the hidden frame refreshing.

Scott PS: I prefer this to a bunch of elsif statements <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

Personally, I don't like the if ... elsif ... else statements myself. I find it really cumbersome for very large programs.

My lastest kick is using references to manage what action the program should take based on form input. For example, one action could be to display "introductory" or "help" information, another could be to display user options. Since I wanted each section to have different headings, suboptions, etc., I found that using subroutine and array references was the easiest way to do this.

Here's how I use references to make my life easy

By creating an array for section elements, individual subroutines for each section, and creating a hash that associates the array and subroutine to an individual section, I was able to easily manage a large program as well as add and delete sections and section elements as needed.

This way, by simply passing an "action=1", the program checks the hash for the appropriate subroutine and array to use. (I prefer using digits because it lends to greater flexibility (eg $FORM{'action'}++

So first, in a configuration file, I defined arrays that I want to be specific for each section:

Basically, the if block checks to see if the key (which was passed to the program) exists for %accountmain. If it does, it invokes the subroutine that's referenced in %accountmain and the subroutine knows which array to use. You'll just have to be careful (as usual) that the referenced subroutine exists.