php IM advice

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mickey

    php IM advice

    Hi,

    I am writing to ask if anyone could let me know of any tutorials...

    I want to make an add-on for my site. What I want to do is add an
    instant messanger feature, where members can IM each other.

    Preferably, I want to implement this without adding a database table.
    I hope to use a combination of both PHP & Javascript. Is this a
    realistic approach?

    I have looked into this and can't find much information on it.
    If anybody has ever done such a feature for their site and has any
    articles/tutorials.. on this subject i'd aprechiate it if they could
    pass them on. Or also any opinions.

    Thanks in advance,
    Mikey

  • Oliver Saunders

    #2
    Re: php IM advice

    > Preferably, I want to implement this without adding a database table.[color=blue]
    > I hope to use a combination of both PHP & Javascript. Is this a
    > realistic approach?[/color]

    Its doable. But I think using a database would be easier and give better
    performance. Then again if you have no experience of database the former
    probably isn't true.

    I'd use an XML file.

    - Have a form with name and message field or whatever you want. File
    called "mainsite.h tml" say. Give the form action "addim.php"
    - In "addim.php" make sure you don't echo anything and just write the
    code to add the message to the XML file and then use Header("Locatio n:
    mainsite.html") to send the user back to the same page. The user should
    see nothing change at all but the processing will have been completed.
    - Back in mainsite.html use a frame (anything that you can use to
    display something from an external file) to show your instant messages.
    Then that will automatically call "parseims.p hp" every time
    "mainsite.h tml" is loaded
    - Create "parseisms. php" to display the last 5 or so entries in the XML
    file, and possibly delete those above to keep things fast.
    - You could use JS in mainsite.html to refresh the contents of the frame
    periodicly which you wouldn't be able to do with inline html code such
    as a layer or table. Actually thinking about it you might but its
    harder, depends how much you dislike frames.

    I might try something like this for my own site come to think of it

    Ollie

    Comment

    Working...