我有这段代码:
private function sendToInfusionsoft($xid, $form_name, $firstname, $lastname, $email)
{
$url = "https://company-name.infusionsoft.com/app/form/process/{$xid}";
$params = [
'inf_form_xid'=>$xid,
'inf_form_name'=>$form_name,
'infusionsoft_version'=>'1.62.0.45',
'inf_field_FirstName'=>$firstname,
'inf_field_LastName'=>$lastname,
'inf_field_Email'=>$email
];
$params = http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_exec($ch);
curl_close($ch);
}
但是当我在浏览器中运行它时,浏览器的网址实际上是重定向到https://company-name.infusionsoft.com/etc-etc
这怎么不在后台运行?为什么这会在地址栏中显示出来?出于这个原因,它没有重定向到我的网站网址。