PHP
  Home arrow PHP arrow Page 4 - Coding Folders for a PHP Email Applica...
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Coding Folders for a PHP Email Application
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2006-11-15

    Table of Contents:
  • Coding Folders for a PHP Email Application
  • Form Data
  • Explaining Sections B and C
  • The Sent, Trash and Drafts Folders

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Coding Folders for a PHP Email Application - The Sent, Trash and Drafts Folders


    (Page 4 of 4 )

    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 =
    '".$_SESSION['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
    ['sent_id'];?>" class="email"><?=$r['to'];?></a>

                                    </td>

                                     <td valign="top" class="list"><?
    =$r['from']; ?></td>

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


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Hi Leidago, as I have commented before on the articles about the invoicing system, ...
       · Thank you for your critique, but i'm afraid We are just going into circles on the...
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT