Re: [PHP] How to store data that doesn't change?

2010-09-18 Thread chris h
On Sat, Sep 18, 2010 at 12:37 PM, Ashley Sheridan wrote: > On Sat, 2010-09-18 at 12:21 -0400, chris h wrote: > > When you really NEED a global resource I'm a fan of a registry class. It's > a little slower but not noticeable in most cases. > > With a registry you can store all global data in a s

Re: [PHP] How to store data that doesn't change?

2010-09-18 Thread Ashley Sheridan
On Sat, 2010-09-18 at 12:21 -0400, chris h wrote: > When you really NEED a global resource I'm a fan of a registry class. It's > a little slower but not noticeable in most cases. > > With a registry you can store all global data in a single, controlled area. > You can also store arrays and reso

Re: [PHP] How to store data that doesn't change?

2010-09-18 Thread chris h
When you really NEED a global resource I'm a fan of a registry class. It's a little slower but not noticeable in most cases. With a registry you can store all global data in a single, controlled area. You can also store arrays and resources instead of just strings. One down side to most registr

Re: [PHP] 1984 (Big Brother)

2010-09-18 Thread chris h
So whenever the boss is in a meeting and his screen saver kicks on then the business shuts down. Also I think we've established that thumbdrive + database = disaster. Maybe a thumbdrive that has file with some random hash. Then create a cron that checks for the existence of that file each minute

Re: [PHP] 1984 (Big Brother)

2010-09-18 Thread TR Shaw
If you mean "not logoff properly" as, for instance, getting up and leaving his office for the day without logging off you can run a script when the machine "sleeps" or the screen saver runs and runs again when the machine transitions back to run. If your talking about powering off, same scripti

Re: [PHP] Checking file type when uploading

2010-09-18 Thread Ashley Sheridan
On Sat, 2010-09-18 at 02:46 -0700, Michael Shadle wrote: > There is a fileinfo module for php (and it's packaged in 5.3) > > http://www.php.net/manual/en/intro.fileinfo.phphttp://www.php.net/manual/en/intro.fileinfo.php > > However after trying to use "file" in a system call back in the day its

Re: [PHP] Checking file type when uploading

2010-09-18 Thread Michael Shadle
There is a fileinfo module for php (and it's packaged in 5.3) http://www.php.net/manual/en/intro.fileinfo.phphttp://www.php.net/manual/en/intro.fileinfo.php However after trying to use "file" in a system call back in the day its great with graphics and some other stuff, but a large number of the

Re: [PHP] Checking file type when uploading

2010-09-18 Thread Ashley Sheridan
On Sat, 2010-09-18 at 11:21 +0200, Peter Lind wrote: > On 17 September 2010 23:25, Jim Lucas wrote: > > Catherine Madsen wrote: > >> Hi! > >> > >> I have created a form following the PHP manual to upload files and need > >> to restrict the upload to only PDF. How do I check the file type > >> ($

Re: [PHP] Checking file type when uploading

2010-09-18 Thread Peter Lind
On 17 September 2010 23:25, Jim Lucas wrote: > Catherine Madsen wrote: >> Hi! >> >> I have created a form following the PHP manual to upload files and need >> to restrict the upload to only PDF.  How do I check the file type >> ($_FILES['userfile']['type']?) and where: on the form page or on the >

Re: [PHP] Removing empty paragraphs from HTML file using simple_html_dom.php

2010-09-18 Thread Simon J Welsh
On 18/09/2010, at 6:21 PM, Geoffrey van Wyk wrote: > Hi All, > > I want to remove empty paragraphs from an HTML document using > simple_html_dom.php. I know how to do it using the DOMDocument class, but, > because the HTML files I work with are prepared in MS Word, the DOMDocument's > loadHTM