PHP
  Home arrow PHP arrow Page 7 - Building A PHP-Based Mail Client (part 1)
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

Building A PHP-Based Mail Client (part 1)
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 39
    2002-01-02


    Table of Contents:
  • Building A PHP-Based Mail Client (part 1)
  • Requiring Immediate Attention
  • Start Me Up
  • Fully Function-al
  • Opening Up
  • Calling The Exterminator
  • Back To Square One

  • 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


    Building A PHP-Based Mail Client (part 1) - Back To Square One
    ( Page 7 of 7 )

    Now, that entire effort was a pretty major exercise - especially if, like me, you hadn't done it before. And I'm not done yet - I still need to figure out how to handle attachments. But before I go there, I'd like to close up this first part with a look at, appropriately enough, the "logout.php" script.

    You'll remember, from a couple pages back, that the page header includes some code to display a link to log out of the system. This link points to "logout.php", an extremely simple script which destroys the session created at the time of logging in, and sends the browser back to the application's index page.

    Take a look:

    <? // logout.php - destroy session // destroy session variables and send back to login page session_start(); session_unregister("SESSION"); session_unregister("SESSION_USER_NAME"); session_unregister("SESSION_USER_PASS"); session_unregister("SESSION_MAIL_HOST"); header("Location:index.php"); ?>
    If you look at "login.php" again, you'll see that I'm simply destroying, via session_unregister(), the session variables created at login time. This is necessary to avoid having one user's sensitive account information "inherited" by subsequent users.

    Once the session has been destroyed, the browser is redirected back to the index page. And so the cycle continues...

    That's about it for this opening segment. In this article, you learned a little bit about the basics of designing software applications - namely, putting down requirements on paper, separating common elements into a single location, and keeping lots of caffeine handy. You also got an introduction to PHP's IMAP functions, using built-in IMAP constructs to connect to a POP3 server and obtain a detailed message listing from it. Finally, you learned a little about PHP's session management functions, with code illustrations of how to create, use and destroy session variables.

    I still have a long way to go before this application is complete. My primary problem right now is understanding how to handle attachments, both so that I can display (and download) them, and so that I can attach them to new messages or replies. I plan to bone up on a little theory before attempting this - come back next week and I'll tell you what I find out.

    Note: All examples in this article have been tested on Linux/i386 with Apache 1.3.12 and PHP 4.0.6. Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article. YMMV!

     
     
    >>> More PHP Articles          >>> More By icarus, (c) Melonfire
     

       

    PHP ARTICLES

    - Using Directory Iterators to Build Loader Ap...
    - Using the spl_autoload() Functions to Build ...
    - Working Out of the Object Context to Build L...
    - Using the _autoload() Magic Function to Buil...
    - The Destruct Magic Function in PHP 5
    - The Autoload Magic Function in PHP 5
    - Developing a Recursive Loading Class for Loa...
    - The Sleep and Wakeup Magic Functions in PHP 5
    - Using the Clone Magic Function in PHP 5
    - Including Files Recursively with Loader Appl...
    - The Call Magic Function in PHP 5
    - Designing a Captcha System with PHP and MySQL
    - Using Static Methods to Build Loader Apps in...
    - The Isset and Unset Magic Functions in PHP 5
    - Advanced PHP Form Input Validation to Check ...





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