Internal Mailing System

the mail() function

Moderators: macek, egami, gesf

Post Reply
User avatar
bigjoe11a
New php-forum User
New php-forum User
Posts: 137
Joined: Wed Aug 31, 2011 3:55 am
Location: USA
Contact:

Re: Internal Mailing System

Post by bigjoe11a » Sun Jan 29, 2012 6:26 pm

To give you an idea on how to do this. Create one new table in your database.
Table Name `users_pm`
id Record Id
tuid To user ID
fuid From User ID
fname From User Name
subject Subject of message.
msgdate Date of Message
msg Message Text

Create a function that will check to see if the current log in user has any messages.

Code: Select all

Function CheckPM()
{
   //connect to mysql database
   //mysql_select_db('database');

   $query = mysql_query("select * from `users_pm` where uid = {$_SESSION['userid']}");
   $record = mysql_fetch_array($query);

    foreach($record as $upm)
     {
        echo 'From :'.$row['fuid'];
        // and so on. Just display the messages from that user. You can include what you wanted the
        // user is view. You can create links to view and reply to the message. Just use the same table.
     }

mysql_close();   

}
Hope this helps

Joe

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests