473,473 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PHP cron job file download

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
3 3177
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: deko | last post by:
Is there a way to get my script to run on regularly scheduled intervals without using cron? My hosting provider sucks... cannot use cron... I was thinking perhaps I could create a file every hour...
6
by: sherryonline | last post by:
i have a page and i need that page to be called every day at 12:00 that page is going to connect to the database fetch some emails and will start mailing them how i am goning to do this.
4
by: vagrantbrad | last post by:
I'm using python 2.4 running on Fedora Core 4. I have written a python program called ipscan.py that checks the external ip address of my cable internet connection, and on change, will update the...
3
by: the.natalie | last post by:
Hi. I am a newbie to mysql, cron, and shell scripting, so please bear with me. I have a script that is used for updating an image directory based on contents in a database. The script does the...
0
by: Nikola Skoric | last post by:
Hello, I have a few lines of code retrieving a web page and saving some variables from it to a log. And everything works nice from command line. but, when I make a cron job, I get an error: ...
5
by: jcor | last post by:
Hi, I'm trying to run my first cron job, probably it's missing something. I created a perl script just to test, it's called "teste" !/usr/bin/perl open(DATA,">>/home/joao/files/output"); @Now...
4
by: Phil | last post by:
I have a php script that queries some Oracle DB and outputs a single line of plain text with <brat the end for each query. This is Apache2, php4.4.8 and Oracle Instant Client 10.1.0.5 all on CentOS...
5
by: Lawrence Krubner | last post by:
Do any problems come up when using a static variable in a cron job? Assuming the cron job is called every 5 minutes for one year. Assume I've got an array that stores the names of which users are...
0
by: Cameron Simpson | last post by:
On 17Aug2008 21:25, John Nagle <nagle@animats.comwrote: Because $HOSTNAME is a bash specific variable, set by bash but NOT EXPORTED! Like $0 and a bunch of other "private" variables, subprocesses...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.