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

Home Posts Topics Members FAQ

Triggering a script from another script

Dear readers of comp.lang.php,

I recently finished a script for a website, and altough
I'm happy with it, it's a bit too slow, due to the many
and somewhat complex queries to a MySQL database.

This has been partially solved writing the script so
that only the first person after midnight that requests
that page actually generates it. Everybody else will
get the stored html file out of that first request until
the next midnight.

A new opportunity has arisen though, because altough another
person would have to set it up, now it would be possible to
run a script through a cronjob.

Ideally, to avoid touching the first script, I'd write a
second, to be run through cronjob, that act like a browser
and triggers the page generation sometime after midnight.

I therefore tried something simple like this:

----
#!/usr/sbin/php

<?php

header("Location: http://www.euroharmony.com/~manu/hubstats2.php?which=ESSA&page4&force=1");
exit;

?>
----

But it doesn't actually do anything else other than print out

Location: http://www.euroharmony.com/~manu/hub...&page4&force=1
Content-type: text/html

What should I do instead? Am I using the wrong command?
Any hint? tip? trick?

Thank you!

Manu
Jul 17 '05 #1
3 3927
On 21 Oct 2003 03:54:55 -0700, ma****@mclink.it (Emanuele D'Arrigo)
wrote:
Ideally, to avoid touching the first script, I'd write a
second, to be run through cronjob, that act like a browser
and triggers the page generation sometime after midnight.


Just call your script from the command line:

/path/to/php /path/to/your/script.php

No need for a second script.

I've used this with crontab without any problem (to send daily
e-mails).

--
David ( @priz.co.uk )
The Internet Prisoner Database: http://www.priz.co.uk/ipdb/
The Tarbrax Chronicle: http://www.tarbraxchronicle.com/
Jul 17 '05 #2
> Just call your script from the command line:
/path/to/php /path/to/your/script.php
No need for a second script.


Yep, this is the way to run any script from
command line, but as you might have noticed
from the URLs above, I pass a few parameters
through the URL.

This means that I'd have to change the first
script to handle command-line style arguments,
which I'm trying to avoid.

Manu
Jul 17 '05 #3
On 22 Oct 2003 03:26:37 -0700, ma****@mclink.it (Emanuele D'Arrigo)
wrote:
Just call your script from the command line:
/path/to/php /path/to/your/script.php
No need for a second script.
Yep, this is the way to run any script from
command line, but as you might have noticed
from the URLs above, I pass a few parameters
through the URL.


Oops. Didn't spot that.
This means that I'd have to change the first
script to handle command-line style arguments,
which I'm trying to avoid.


Look at wget or lynx.

--
David ( @priz.co.uk )
The Internet Prisoner Database: http://www.priz.co.uk/ipdb/
The Tarbrax Chronicle: http://www.tarbraxchronicle.com/
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Tery Griffin | last post by:
Hi all, I¹ve been away from Javascript for awhile and am rusty, but this is too simple not to work! I¹m on a Mac, and usually use the Safari browser. I have a very basic web page in a frame. ...
13
by: Benny | last post by:
Dear All, I need to send a set of Emails from my application (reminders) each month 1st. Is there anyway in ASP scripts to trigger an event to run automatically? I have no dedicated server, so...
13
by: aundro | last post by:
Hello, I've been looking on the web for a solution to this problem: I create a set of checkboxes, and 2 buttons: - one is labeled "All" - the other is labeled "None" Clicking "All" is...
3
by: Corobori | last post by:
In my form my users are entering some data, one of them being a dropdownlist. When an item is choosen from that dropdownlist I am posting back to the server in order to retrieve some data from the...
8
by: Steve Schroeder | last post by:
For some reason I cannot get the OnSelectedIndexChanged event to fire for a listbox I have on a page. I'm able to populate the listbox with data from a stored procedure, but cannot trigger the...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
4
by: Adam Smith | last post by:
Hello, How can I call or trigger an external javascript twice in a form? I have <script language="JavaScript" src="country_state.js" name="Country_State"> <script type="text/javascript"...
1
by: nimad | last post by:
Hello, I would like to modify the content of the location bar (address bar) using JavaScript. Suppose I am at http://localhost/WebTests/TestEvent.aspx The followig line: window.location =...
1
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
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.