By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,747 Members | 1,701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,747 IT Pros & Developers. It's quick & easy.

PHP cron job file download

P: n/a
JS
I go to a website once a week to download public data. Upon submitting
a form, a text file is producted and I get the usual Windows dialog
box asking if I would like to open or save the text file locally. I
save it locally.

I am thinking about setting up a php script on an Apache server I use
to host some websites. Basically, I would like the script (which is
nothing more than a pre-populated form) to run as a cron job, get the
text file and then email it to me.

My questions: (1) Is this possible and (2) If so, if the form is
submitted from the server, where does it get saved? And what will it
be named?

Thanks, J

[Please don't email me. This is my no-spam address.]
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
jo*****@ireland.com says...
I go to a website once a week to download public data. Upon submitting
a form, a text file is producted and I get the usual Windows dialog
box asking if I would like to open or save the text file locally. I
save it locally.

I am thinking about setting up a php script on an Apache server I use
to host some websites. Basically, I would like the script (which is
nothing more than a pre-populated form) to run as a cron job, get the
text file and then email it to me.

My questions: (1) Is this possible
Yes.
(2) If so, if the form is
submitted from the server, where does it get saved? And what will it
be named?


Don't use your existing form.

Write a separate PHP script to be run by the cron that just creates a
temporary file rather than saving it on the server, use a date stamp in
the file name that you use to attach it to your email.

Geoff M
Jul 17 '05 #2

P: n/a
JS <jo*****@ireland.com> wrote:
I am thinking about setting up a php script on an Apache server I use
to host some websites. Basically, I would like the script (which is
nothing more than a pre-populated form) to run as a cron job, get the
text file and then email it to me.


I'd seriously consider another language (or even another tool) for this
task. curl, wget are decent tools for this type of thing. lynx is so-so
(but if you don't have curl or wget it may be better than nothing)

Failing that, I'd use perl and LWP.

I'm not slamming PHP, but using it for batch procesing is kind of like
using a car to knock down a building. Yea, it might work, but a
bulldozer would be better. :-)

Jamie

Jul 17 '05 #3

P: n/a
In article <T4Vfc.4539$0b4.14073@attbi_s51>, th******@yahoo.com wrote:
JS <jo*****@ireland.com> wrote:
I am thinking about setting up a php script on an Apache server I use
to host some websites. Basically, I would like the script (which is
nothing more than a pre-populated form) to run as a cron job, get the
text file and then email it to me.


I'd seriously consider another language (or even another tool) for this
task. curl, wget are decent tools for this type of thing. lynx is so-so
(but if you don't have curl or wget it may be better than nothing)


curl http://foo | mail bar@invalid

might want to lookup what -d does with curl

--
http://home.mysth.be/~timvw
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.