简体   繁体   English

在php中运行curl两次

[英]Running curl twice in php

I'm trying to send email via php mail function like below but it doesn't seem to work on IE. 我正在尝试通过下面的php邮件功能发送电子邮件,但它似乎不适用于IE。 It works on all other browsers. 它适用于所有其他浏览器。 Below is the code. 下面是代码。 Is there a reason why??? 有什么理由???

$sent1 = mail($to, $subject, $message, $headers);
$sent2 = mail($clientTo, $clientSubject, $clientMessage, $clientHeaders);
if ($sent1 && $sent2){
                    $ch = curl_init("https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8");
                    curl_setopt($ch, CURLOPT_POST, 1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS, "oid=$sf_oid&first_name=$sf_first_name&last_name=$sf_last_name&company=$sf_company&phone=$sf_phone&email=$sf_email&URL=$sf_website&description=$sf_description&lead_source=$sf_leadsource");
                    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                    curl_exec($ch);
                    $info = curl_getinfo($ch);
                    if($_SERVER['REMOTE_ADDR'] == "124.254.75.167")
                        //print_r($info);
                    curl_close($ch);

                    $ch = curl_init("http://www.rankreport.com.au/ajax/add_new_lead");
                    curl_setopt($ch, CURLOPT_POST, 1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS, "lead_company_id=1&lead_business=1234&lead_first_name=asdf&lead_website=12314.com&lead_phone=1234&lead_email=test@test.com&lead_package=seo");
                    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                    curl_exec($ch);
                    curl_close($ch);

                    echo '3';
                }

PHP has nothing to do with browser (PHP is server-side executable), so it isn't browser's problem. PHP与浏览器无关(PHP是服务器端可执行文件),因此它不是浏览器的问题。 You have probably no $sent1 , $sent2 defined 您可能没有定义$sent1$sent2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM