My Domain Host only allows 2 CRON jobs to be set. I have one already set to download a file over FTP
I need to run 10 more Cron Links from a single PHP file. Is this at all possible?
Format of Cron Link (10 Parts): https://www.example.com?route=extension/module/import&import_id=1&part=1_10
Not sure how to test this out in a single PHP file
Would something like this work?
<?php
ini_set('display_errors', 1);
$response=curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=1_10");
curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=2_10");
curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=3_10");
curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=4_10");
curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=5_10");
curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=6_10");
curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=7_10");
curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=8_10");
curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=9_10");
curl_request("https://www.example.com/?route=extension/module/import&import_id=1&part=10_10");
function curl_request($url,$method="GET",$postFields="")
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if($method=="POST")
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
}
else
{
curl_setopt($ch, CURLOPT_HTTPGET, TRUE);
}
$response = curl_exec($ch);
echo "$response";
return $response;
}
?>
Is it possible to add a time out between the links?