Connecting Tech Pros Worldwide Forums | Help | Site Map

php IM advice

Mickey
Guest
 
Posts: n/a
#1: Sep 30 '05
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
Guest
 
Posts: n/a
#2: Oct 14 '05

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.html" 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("Location:
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.php" every time
"mainsite.html" 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
Closed Thread