Web Hosting Talk







View Full Version : how to instant new PM notice??


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??

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.

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.