alwaysvaghu Posted November 10, 2005 Share Posted November 10, 2005 Hello freinds,,,,,If u r using yahoo/msn messanger...then when some one gets onlineAt the bottom side one popup will say that this person is now online....I want to do that...I m creating on chatting module...lookin same as yahoo's chat window..like had a option of group chat..in one side online users.....it also adds in the list when user online....but i want to put the popup when somebody comes online.............vaghu....... Link to comment Share on other sites More sharing options...
Jerome Posted November 10, 2005 Share Posted November 10, 2005 In wich language are you writing your code? Link to comment Share on other sites More sharing options...
alwaysvaghu Posted November 10, 2005 Author Share Posted November 10, 2005 hi...Whole Application is created in Html with the help of php and javascript ......i think for creating the pop-up i must use javascript...actually i have put "window.open()" but there is a message coming Popup is blocked from this site...so what should i do Link to comment Share on other sites More sharing options...
vijay Posted November 11, 2005 Share Posted November 11, 2005 Hi Padu U can use thisLink for thishttp://www.w3schools.com/js/tryit.asp?file...om_window_popupVijay Link to comment Share on other sites More sharing options...
alwaysvaghu Posted November 11, 2005 Author Share Posted November 11, 2005 hi...i have just seen that url..but i have one problem......it is executed when u click on button...i dont want that......i mean i have php code in chat...and it is continuously checking whether any user in online or not...if the code find any online user..it should then show the popup...so u got it now..i think so...how can i automatically run that..without any knid of click.... Link to comment Share on other sites More sharing options...
Jack McKalling Posted November 11, 2005 Share Posted November 11, 2005 JavaScript can do runtime, but only with variables in this case. You have to make sure PHP sends a request for a popup to JavaScript, while JavaScript can't check for online users, and PHP can't show a popup...Can you give us a link to the window opening page? Or an excample of the PHP script you wrote, so we can program or explain a program to do this.. Link to comment Share on other sites More sharing options...
vijay Posted November 11, 2005 Share Posted November 11, 2005 Hi, Padu So Plz Code like that Page is automaticalyy refresh at Some moment and Code of checking Execute Every TimeThat Code is <script type="text/javascript"> function reFresh() { location.reload(true) } window.setInterval("reFresh()",1000); </script>Vijay Link to comment Share on other sites More sharing options...
alwaysvaghu Posted November 11, 2005 Author Share Posted November 11, 2005 here is kind of code with description...<?php$qry = "Select * from users where user_stat='1'"; //find the users from databse//some code here for checking other parameters..and this will find out two parameters "$flag" and "$diff"........if($flag==1 && $diff==0){ //Here i want to show POPUP}?>/////////////////////////////I Am Doin This but its not workin///if($flag==1 && $diff==0){ //Here i want to show POPUP?><script Language = "avascript"> alert(smthing)...// </script<?php}?> Link to comment Share on other sites More sharing options...
vijay Posted November 11, 2005 Share Posted November 11, 2005 Hi, Plz Put PopUp in JS FunAnd Call At Every Time Wheever U reqd Link to comment Share on other sites More sharing options...
Jack McKalling Posted November 11, 2005 Share Posted November 11, 2005 This is a one-time only script, no runtime.You can call with JavaScript every second for instance, to a PHP script. Then it would be runtime, sort of. :)Try to make a function, that connects to the php script, after one second. The php script checks for online users, and passes back the results to the JavaScript (like with header("Location: file.js?online=no"). )If somebd do is online, rewrite the JavaScript with php, with an additional function that shows the popup.Is this understandable, or should I give an example? Link to comment Share on other sites More sharing options...
alwaysvaghu Posted November 11, 2005 Author Share Posted November 11, 2005 sorry yaar...the code which i added in previous reply is correct..actually i was updating other file and opening other file... sorry frnds Link to comment Share on other sites More sharing options...
alwaysvaghu Posted November 11, 2005 Author Share Posted November 11, 2005 This is a one-time only script, no runtime.You can call with JavaScript every second for instance, to a PHP script. Then it would be runtime, sort of. :)Try to make a function, that connects to the php script, after one second. The php script checks for online users, and passes back the results to the JavaScript (like with header("Location: file.js?online=no"). )If somebd do is online, rewrite the JavaScript with php, with an additional function that shows the popup.Is this understandable, or should I give an example?<{POST_SNAPBACK}> I have already done that..thanx yaar "Dan the Proof"I m refreshing the page after 2 seconds Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now