Portal Home > Knowledgebase > Articles Database > how to instant new PM notice??


how to instant new PM notice??




Posted by mjfroggy, 06-27-2008, 12:09 AM
Hello all, I have a php/mysql based Private message system like what a message board like this has. What I am wondering how to do is lets say I send a private message to another person in my site.I want to have a small window pop up on their screen saying they have a new private message. I am thinking this maybe can be done with ajax or somthing. I am just wondering how it would be done I know when I am on here and I get a new PM I get a window that pops up telling me their is a PM for me so how can I do something like that on my site??

Posted by masfenix, 06-27-2008, 01:01 AM
in your DB have a column called "isRead" which is boolean. On your page load query the db if the current user has messages that have isRead = false. Then you can just javascript: alert() it out.

Posted by Codebird, 06-27-2008, 02:41 AM
using ajax will just help you checking every like 5mins and it will alert without loading another page.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
lighttpd and rails (Views: 621)