Reputation: 2209
Is it possible to launch a php file from a other php file? I know that i can include a file but i don't mean this.
Small example: i have a script which displays something from the database and a other script which get the latest data from a other site and update the database.
When i include the update file, the first script will request the data from the server but i want to make it parallel so that only the update script request from server
Upvotes: 1
Views: 191
Reputation: 53851
Yes, and you can use include
provided fopen wrappers are turned on.
include("http://otherserv.com/path/to/script.php");
If you don't care about the reponse from the other server, you can do
get_headers("http://otherserv.com/path/to/script.php");
This will complete much faster if the remote script takes time to process.
Upvotes: 4
Reputation: 181270
Yes, you need CURL (or any other HTTP library) to "run" a php file from another as you described in your scenario.
So, in your case:
Hope it clarifies something to you.
Upvotes: 0