strujillo Posted August 10, 2008 Share Posted August 10, 2008 Ok so i kind of have a theory. so i create a new database called messages With the following columns to from subject message Ok so when the person sends all this information to the database, how would the person he sent it to view it? im getting stuck here, Maybe if the 'username' and the 'to' match you can view those messages. Thanks Link to comment https://forums.phpfreaks.com/topic/118995-how-to-send-messages-from-one-member-to-another-in-a-php-community-script/ Share on other sites More sharing options...
deadlyp99 Posted August 10, 2008 Share Posted August 10, 2008 Simple. The recieving user visits a message page and page checks the user, and displays messages and the info about them You can just do some basic things: connect to database select messages table where the receiving user matches the user visiting the page (you can use sessions here) load them into an array (while ($var = mysql_fetch_array($sqlstatment) ) and display them within the while ( {echo $var[to] . " " . $var[ect]; } Does that make enough sense? Link to comment https://forums.phpfreaks.com/topic/118995-how-to-send-messages-from-one-member-to-another-in-a-php-community-script/#findComment-612741 Share on other sites More sharing options...
genericnumber1 Posted August 10, 2008 Share Posted August 10, 2008 SELECT * FROM messages WHERE to = '{$_SESSION['username']}' Assuming you've cleaned the session username. You might also wish to include a "read" field to keep up with whether the user has read the message or not... perhaps false if they haven't read it or a timestamp if they have.. just thinking out loud Link to comment https://forums.phpfreaks.com/topic/118995-how-to-send-messages-from-one-member-to-another-in-a-php-community-script/#findComment-612742 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.