hi,
I'm am new to PHP. I have a JAVA application for which I use a custom 500 error page made with PHP. To notify me whenever my Servlet engine is down.
I successfully made the page sent me an email. However, I wish to store some variables globally (servletContext in JAVA) so the page remembers when the last email was sent. This to prevent hundreds of emails from being sent once the server is down.
My question is: How can I store variables globally so all PHP pages, all clients and all requests can use them.
Example code would very much be appreciated.
Kind regards,
Joost Schouten
[SOLVED] global variables
Moderator: General Moderators
-
joostschouten
- Forum Newbie
- Posts: 2
- Joined: Wed Mar 10, 2004 10:50 am
- Location: the Netherlands
How about you use a MySQL or textfile (I recommend this), to store the last date/time of the last email sent. Then before the error email is sent, you can check the current time againts the one in the file.
If hasn't been x minutes or hours, or whatever, you can deny the email from being sent.
Helpful links:
php.net/[php_man]filesystem[/php_man]
php.net/[php_man]date[/php_man]
If hasn't been x minutes or hours, or whatever, you can deny the email from being sent.
Helpful links:
php.net/[php_man]filesystem[/php_man]
php.net/[php_man]date[/php_man]
-
joostschouten
- Forum Newbie
- Posts: 2
- Joined: Wed Mar 10, 2004 10:50 am
- Location: the Netherlands