Dysan Posted March 14, 2008 Share Posted March 14, 2008 Hi, Using PHP, how would you go about creating a simple PM system, that every time the page loads, checks if any new messages have been sent, and navigates to a page upon finding new messages (e.g. http://www.google.co.uk)? Link to comment https://forums.phpfreaks.com/topic/96207-simple-pm-system/ Share on other sites More sharing options...
dbillings Posted March 14, 2008 Share Posted March 14, 2008 like the forum your in now? hit refresh and new posts appear. Link to comment https://forums.phpfreaks.com/topic/96207-simple-pm-system/#findComment-492497 Share on other sites More sharing options...
l0ve2hat3 Posted March 14, 2008 Share Posted March 14, 2008 use ajax Link to comment https://forums.phpfreaks.com/topic/96207-simple-pm-system/#findComment-492505 Share on other sites More sharing options...
graham23s Posted March 14, 2008 Share Posted March 14, 2008 or what i do is just set up a query to run on the particular page: $q_pm = "SELECT * FROM `pms` WHERE `id`='$loggedin_users_id'"; $r_pm = mysql_query($q_pm); if(mysql_num_rows() > 0) { print("You have a private message!"); } there a good few ways to improve it though hope it helps Graham Link to comment https://forums.phpfreaks.com/topic/96207-simple-pm-system/#findComment-492509 Share on other sites More sharing options...
The Little Guy Posted March 14, 2008 Share Posted March 14, 2008 To expand on graham23s query: <?php $q_pm = "SELECT * FROM `pms` WHERE `id`='$loggedin_users_id' AND `viewed`='0'"; // 0 = unread // 1 = read // 2 = replied $r_pm = mysql_query($q_pm); if(mysql_num_rows() > 0) { print("You have a private message!"); } ?> Link to comment https://forums.phpfreaks.com/topic/96207-simple-pm-system/#findComment-492513 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.