Find the answer to your Linux question:
Results 1 to 7 of 7
I have a small message board on an area of a web page thats pulled out of a MySQL dbase with PHP. It acts a bit like a messenger service. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    meta refresh


    I have a small message board on an area of a web page thats pulled out of a MySQL dbase with PHP. It acts a bit like a messenger service. I want it to refresh whenever someone posts a message. Anyone no of an alternative to META REFRESH. something more sophisticated. I don't mind using scripts. I could frame the dam thing so that only that part refreshes but that would most definately complicate my page somewhat.
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284

    Re: meta refresh

    Quote Originally Posted by kpzani
    I have a small message board on an area of a web page thats pulled out of a MySQL dbase with PHP. It acts a bit like a messenger service. I want it to refresh whenever someone posts a message. Anyone no of an alternative to META REFRESH. something more sophisticated. I don't mind using scripts. I could frame the dam thing so that only that part refreshes but that would most definately complicate my page somewhat.
    Not really possible due to the stateless nature of the HTTP protocol.

    You would proberly be looking at writing a custom Java applet for the client side that talks via Sockets with an application server side, to work out if there have been any new posts.

    Jason

  3. #3
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Location
    England
    Posts
    1,219
    Sessions where developed to try and help with that. I dont think you could implement it using php.

  4. #4
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    not good enough

    Don't really want to use a java applet. I try framing it and adding a meta-refresh. all users will be using a newish mozilla, galleon or epiphany or IE 6 on Win XP (which doesn't come with a JVM).

    thanks anyway guys.
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

  5. #5
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    javascript

    what about using a javascript timer? if I had a function managing the timer and then sending the page to the same location every X minutes. I could then check a global var like doRefresh (boolean) and in this way disable the refresh if the user is doing something like entering data into a form.

    Would this have a bad effect on mem usage / browser performance?

    I've seen online tests that use Javascript to end the test after 30mins. So i could appropriate this type of code and modify it to my needs.

    Any comments
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

  6. #6
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    Your first post asked how you can refreash a clients browser window when ANOTHER person posts a message. The point is, due to the HTTP protocol, there is NO WAY for the server to notify OTHER client browsers that someone has posted.

    The best you can get, is to use a meta refresh (or javascript if you really want), to reload an iframe every x minutes. This wont interfear with the rest of the page, or if somone is entering data into a form or whatever.

    Jason

  7. #7
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    iframe

    thanks. I understand what you are saying. I wanted to avoid frames - as mozilla displays frame borders horribly.

    I have just tried the iframe idea - it works well.
    just a question though, is it ok to use iframes? I thought they were an IE thing. but mozilla is displaying it fine.
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

Posting Permissions

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