SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Reading and displaying server file content for users onlince

    Hi Folks,

    I hope someone can help me out with this:

    I would like to display the number of users online on a web site.

    A php script runs every 5 minutes and screens the logfile. It then writes the number of users online (different IPs) to a file.

    Now the page displayed is static html. How can I utilize javascript to read the number from the file and display it somewhere on the page?

    Thanks,

    Klaus

  2. #2
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    with ie you could use the document.getElementsByTagName("script")[0]="newVariable.js" method, just create a logedNumber variable in an external JS file

    or for ie and ns you could save it as a XML file, which then can be checked every few seconds

    cross browser you could use frames or iframes, then get these to refresh at set intervals
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  3. #3
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Markdidj

    thanks for your suggestions.

    I solved the problem using SSI. A very simple way to display the files content.

    Thanks,

    Klaus


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •