在我制作脚本后,我试图自动将 cron 上的表单提交到外部 url 我从外部站点收到此错误
An Error Was Encountered
The action you have requested is not allowed.
无论如何我可以解决这个问题吗?
这是卷曲代码
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.extsite.com/submit");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'contenttitle' => '$title',
'contentpath' => '$path',
'submit' => 'submit'
));
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
echo "$result";