Hi!
I have a script that records statistics and want it to send the statistic to me via email everyday automatically without me even visiting the site.
How would I get it to send it to me automatically?
Thanks
Ben
Making Things "Automatic"
Moderator: General Moderators
Its called a 'cron' on Unix systems. Unfortunately, many hosts do not allow php to be run from the command line, which is how yiou would have to do it, and if yours doesn't option 2 is to learn Perl or C and write one, or hire someone to do it for you.
Option 3 is to put a machine in the closet with a browser always open to your script and use Javascript timers, PHP sleep command, or time checking to tell it when to run the script. But, as I said, unless your ISP allows php from a command line.....
Option 3 is to put a machine in the closet with a browser always open to your script and use Javascript timers, PHP sleep command, or time checking to tell it when to run the script. But, as I said, unless your ISP allows php from a command line.....
Although this system isnt perfect, and does depend on traffic, you could set up a script that is at the top of the page and always running no matter where the user is on the site. set up a time stamp field, and have it check it each page. once its at the time you want, submit the stats to you through email. This is what im using for deleting old accounts and logging people off when they arent active, so far it works fine... Or you could put together a javascript clock and when it reaches zero have it forward to the execute page, and have a header on the execute page to go back to the clock, and just run this on the server, not sure if it could slow anything down if its only done once every 24 hours...
Yeah, well what does that have to do with it? You don't know how they do it. They are probably just using a listserv or something.Mr. Tech wrote:hmmm... I didn't realise it would be so hard... I noticed a program called phpAdsNew was able to send emails at any time...
Not hard. Hell, I've read a lot of easy options here.