Hi friends,
i have issues in creating messagner in php .
in that am using ajax , php and mysql to create messagner.
am using two pages messagner login window(messagner login.php) ) and mesagner chat window(messagner.php)
the following lines am giving my issues how to solve that,
1.when the person (x) is sending message to person(Y) in that,the person(X) corrsponding windows is open already,
in mycode, am refreshing the page( messagner login.php) at regular intervals for identifying if the person received any message from other users,its for opening the messagner window.
i.e if the person(x) sended message to person(y) when the person(y) logined to show the messagner box with person(x) sended message.after that,they both chat vice versa through that messagner window.
but if the person(y) sending the respose message to person(x) here messagner window is refreshing only once.here is that my issue i dont want to refresh the person(x) window after the person opened already.
i hope i get excellent ideas from this forum,and also new chat idea also am excepting please any one reply me fastly.
PHP/JS messengerhow to create php instant messanger
Page 1 of 1
4 Replies - 857 Views - Last Post: 17 August 2009 - 10:27 AM
Replies To: PHP/JS messenger
#2
Re: PHP/JS messenger
Posted 17 August 2009 - 01:51 AM
This issue is more related to Javascript than to PHP... Well...
All comes down to how you open your chat windows, a simple javascript popup or some kind of a custom window? No matter how you do it you should be able to keep a reference to the window you have opened, when you get a new message for a specific user check if a window is already opened using the corresponding window-reference (if there are any yet). If the window is not open or if a reference does not exist open a new window.
All comes down to how you open your chat windows, a simple javascript popup or some kind of a custom window? No matter how you do it you should be able to keep a reference to the window you have opened, when you get a new message for a specific user check if a window is already opened using the corresponding window-reference (if there are any yet). If the window is not open or if a reference does not exist open a new window.
#3
Re: PHP/JS messenger
Posted 17 August 2009 - 03:37 AM
Wimpy, on 17 Aug, 2009 - 12:51 AM, said:
This issue is more related to Javascript than to PHP... Well...
All comes down to how you open your chat windows, a simple javascript popup or some kind of a custom window? No matter how you do it you should be able to keep a reference to the window you have opened, when you get a new message for a specific user check if a window is already opened using the corresponding window-reference (if there are any yet). If the window is not open or if a reference does not exist open a new window.
All comes down to how you open your chat windows, a simple javascript popup or some kind of a custom window? No matter how you do it you should be able to keep a reference to the window you have opened, when you get a new message for a specific user check if a window is already opened using the corresponding window-reference (if there are any yet). If the window is not open or if a reference does not exist open a new window.
yes,i did it,here is my sample code
function call()
{
var new_window;
if(!new_window||new_window.closed)
{
new_window =window.open('index.html',''xxxx","height=400,width=500");
}
else
{
new_window.focus();
}
setTimeout("call()",1500);
}
in this,the code is window is already opened and new window is opening continusoly.
how to solve that..
<html>
<body onload="call()">
welcome
</body>
</html>
am using
#5
Re: PHP/JS messenger
Posted 17 August 2009 - 10:27 AM
What is the problem? Does multiple windows appear or what? What you have there should work just fine without opening multiple windows! Be more specific please!
it_1, on 17 Aug, 2009 - 12:37 PM, said:
yes,i did it,here is my sample code
in this,the code is window is already opened and new window is opening continusoly.
how to solve that..
am using
function call()
{
var new_window;
if(!new_window||new_window.closed)
{
new_window =window.open('index.html',''xxxx","height=400,width=500");
}
else
{
new_window.focus();
}
setTimeout("call()",1500);
}
in this,the code is window is already opened and new window is opening continusoly.
how to solve that..
<html> <body onload="call()"> welcome </body> </html>
am using
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|