Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 151097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:23:44+00:00 2026-05-11T09:23:44+00:00

I am building a POP3 mailbox in PHP. I have the following files :

  • 0

I am building a POP3 mailbox in PHP. I have the following files:

  • server_access.php (fetch mails from the POP3 server)
  • data_access.php (which fetches/writes mails to local DB)
  • mime_parser.php (parses MIME content)
  • core.php (uses above files and stores parsed mail as an assoc array called $inbox)

Now, I have the pages mailbox.php to show the inbox and showmail.php to display each mail. The user’s credentials are stored in a .ini file and used as necessary. The thing is, I do a require_once(‘core.php’) in both mailbox.php and in showmail.php

I am able to display the inbox (ie. $inbox has values), however, if i select to read a mail (pop-up window of showmail.php), the $inbox is an empty array.

$inbox is define as a static array in core.php

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:23:45+00:00Added an answer on May 11, 2026 at 9:23 am

    Static data is only static within the context of a class, meaning a static data member in a class is shared by all instances of that class.

    What you seem to be talking about is data persisting across multiple HTTP requests. Static data won’t do that for you. That’s what $_SESSION data is for.

    To put it another way: once a script finishes servicing the current request, it completely dies. All data is had is completely cleaned up. The new request starts fresh.

    Session data persists until PHP decides to clean it up or you manually destroy it. Typically all you have to do to use session data is put in your script:

    Script 1: mailbox.php

    session_start(); $_SESSION['mailbox'] = array( /* messages */ ); 

    Script 2: showmail.php

    session_start(); $mailbox = $_SESSION['mailbox']; 

    One thing to note: if your script is long-running try and put a session_commit() in as soon as possible because session access blocks in PHP, meaning if another script tries to session_start() for the same user it will block until the first script finishes executing or releases the session.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Building a website using a PHP based Ecommerce product Magento. The problem I have
building a site which has content for each section. urls range from; /work/ /work/print/
building on my last question jQuery getting values from multiple selects together I have
Building the project throws the following error from AAPT. I've rebuilt the project, but
In building a Tumblr theme I've got an external .css on my server which
Building a solution from Visual Studio in mono develop seems to have some issues.
Building an inventory system. I have lots of products and each product has three
building a site using PHP and MySQL that needs to store a lot of
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
I´m building a small application with Jquery and PHP. Jquery (index.html) adds Form Fields

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.