PHP
  Home arrow PHP arrow Coding Folders for a PHP Email Application
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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: starstarstarstarstar / 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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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
    ( Page 1 of 4 )

    In this article, the fourth and final one of our series covering the creation of a PHP email application, we are going to look at the code for some of the remaining pages of the mail application. Chief among these is the NewMsg.php page, which is where items, to be more precise, new messages, are either saved as drafts or saved as sent messages.

    Let's see how this one script affects the other ones. Here's an illustrative diagram:

    NewMsg.php - > Sent message

             |____________________

             |                                       |

    Drafts Folder                       Sent Message FolderOptional

    Let's start with the NewMsg page. First you are presented with a form that will take the following input: To, Cc, BCc, Subject, Attachment and message text. All of these are required to send a valid email message.

    <table width="100%" border="0" class="block">

            <tr>

              <td width="10%" valign="top"><strong>To</strong></td>

              <td width="90%"><input name="to" type="text" id="to"
    size="70"  value="<? if(isset($r['to'])){

                              $r['to'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Cc</strong></td>

              <td><input name="cc" type="text" id="cc" size="70"
    value="<? if(isset($r['cc'])){

                              $r['cc'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Bcc</strong></td>

              <td><input name="bcc" type="text" id="bcc" size="70"
    value="<? if(isset($r['bcc'])){

                              $r['bcc'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Subject</strong></td>

              <td><input name="sub" type="text" id="sub" size="80"  value="<? if(isset($r['subject'])){

                              $r['subject'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Attachment</strong></td>

              <td>

                              <input name="userfile" type="file"
    id="userfile" size="80" value="<? if(isset($r['attachment'])){

                              $r['attachment'];} ?>"/></td>

            </tr>

            <tr>

              <td valign="top"><strong>Message:</strong></td>

              <td><? $checked = false;

                              if($checked){ ?>

                              <textarea name="msg" cols="90" rows="9"
    id="msg"><? if(isset($r['msg_body'])){

                              $r['msg_body'];} } ?></textarea>

                              <? if($checked){

    // Automatically calculates the editor base path based on the
    _samples directory.

    // This is useful only for these samples. A real application
    should use something like this:

    // $oFCKeditor->BasePath = '/FCKeditor/' ;   // '/FCKeditor/' is
    the default value.

    $sBasePath ='fckeditor/fckeditor.php';

    $oFCKeditor = new FCKeditor('FCKeditor1') ;

    $oFCKeditor->BasePath         = $sBasePath ;

    $oFCKeditor->Value               = 'This is some <strong>sample
    text</strong>. You are using <a
    href="http://www.fckeditor.net/">FCKeditor</a>.' ;

    $oFCKeditor->Create() ;

    }

    ?>

                              </td>

            </tr>

            <tr>

              <td>&nbsp;</td><*/span>

              <td><input type="submit" name="Submit" value="Send
    Message" />

                <input name="draft" type="submit" id="draft"
    value="Save As Draft" />

                <input name="save" type="checkbox" id="save"
    value="checkbox" />

                Save Sent Message</td>

            </tr>

          </table>

    The text in red shows a selection of choices. The first choice is to just send the message as is. The second gives you the option of  saving the message as a draft, and the third choice gives you the option of saving the message in the "Sent Messages" Folder. Some of these choices can be made simultaneously and others cannot. For example, if you click on "save as draft" then the message will be saved in the drafts folder instead of being sent. On the other hand, if you want to send the message and save it in the sent folder, that is allowed.



     
     
    >>> More PHP Articles          >>> More By Leidago
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT