Answer the question
In order to leave comments, you need to log in
Cron does not start using an external service, how to fix it?
Faced a problem.
You need to run a php file that sends certain data to another site.
script.php file.
Inside the code
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'urlsite' => $url,
'text' => $text,
'Button' => 'get'
));
curl_setopt($ch, CURLOPT_USERAGENT, 'MSIE 5');
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
$res = curl_exec($ch);
if (!$res)
{
$error = curl_error($ch) . '(' . curl_errno($ch) . ')<br>';
echo $error;
}
curl_close($ch);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question