I have created a php/mysql based chat page.It is like gmail chat.once i click on a online member,chat box will open in the bottom right side. I have a seperate page for chat which includes javascripts and css’s. It works well.
The problem i have is, I need to add that chat page to all my webpages.Because i have some various areas in my website. And i want my members to continue their chat even they visit to another page in my website.
problem arise at that point.
I Used
<?php include('pathtomychat.php');?> in all my webpages. Online friends are appearing correctly.but if i started a chat with a person and suddenly visit to another page, that opened chat box is no longer visible in new page. if i again click the member i have chatted, the chat box is appearing, but my chat messages won’t receive to the member.
I have tried thousands of time using googling for an answer but i couldn’t.
I saw there are so many chat scripts that works well in multiple pages by just using small javascript snippets.how they do that?
I can’t solve this problem. I’ll be thankful if you can tell why this is happens and what should i do to overcome this situation.
Thank you Very much
I can’t answer why someone put a negative. I guess because you didn’t show any code…
Anyway, onto your question. When you go to a new page, you’re reloading your
include "pathytomychat.php";Which kills whatever was opened and just reloads it. You would have to include some way of checking to see if that window is open and then checking if it’s open…off the bat I would so something like this inside your pathtomychat.php
Of course, if you’re opening the window with JS, you’ll need to make sure you set the session that way as well. You could also use Cookies…