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