The above folders have similar code, so I'm not going to list the code of each of them here. Let me explain what happens when you want to view the items inside a folder. A query string variable called userID is received, which is used to retrieve messages related to that user. Then a query is run on the table of the related folder (can be the sent, trash or drafts table). Based on the results of that query, a dynamic table is created and all the messages are listed. Here's the code for the Sent folder: <? include "connect.php"; //get all msgs $query_msgs = "select * from sent WHERE userid = $re = mysql_query($query_msgs); $n = mysql_num_rows($re); if($n > 0){ while($r = mysql_fetch_array($re)) { ?> <tr class="td"> <td valign="top" class="list"> <a href="NewMsg.php?sid=<?=$r </td> <td valign="top" class="list"><? <td valign="top" class="list"><?=$r['subject']; ?></td> </tr> <? } } ?> Conclusion That's it! You should now have a fully functional PHP email client. I've used very general code to make it easy for you to adapt it to your liking. The basics are covered, so any changes you make to this will just make your client more useful. In the NewMsgs page I've used a text editor called fckEditor because it makes it possible to format the text, and in so doing enables you to sent HTML email messages. You can download this editor from the Internet, it is entirely free. Also, if you do not want to use this editor, you can use the normal textarea form element instead.
blog comments powered by Disqus |
|
|
|
|
|
|
|