我正在尝试使用 Curl 将数据发布到外部 URL,但出现错误
Parse error: syntax error, unexpected T_STRING, expecting ')' in send.php on line 8
这就是 send.php 的样子:
<?php
// Initialize curl
$curl = curl_init();
// Configure curl options
$opts = array(
CURLOPT_URL => 'https://zapier.com/hooks/catch/n/abcd/'
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => 'guid='+ echo $_POST["guid"]; + '&video_title=' + echo $_POST["video_title"]; + '&email=' + echo $_POST["email"];
);
// Set curl options
curl_setopt_array($curl, $opts);
// Get the results
$result = curl_exec($curl);
// Close resource
curl_close($curl);
echo $result;
?>
我仍然是 php 的菜鸟,所以非常感谢任何帮助:)