Я пытаюсь сделать завитущее соединение, которое отправляет отправку сообщения на два внешних db, первое соединение получает массив исходных сообщений, второй получает восстановленный ассоциативный массив. Странно первое не работает, а второе.Одно соединение cURL не работает, но второе -
Я не могу понять, как получить этот редактор, чтобы я мог отправить код. Я попытался нажать кнопку кода в меню, я попробовал поставить 4 пробела перед всеми строками, но он постоянно жалуется на код каждый раз, когда я отправляю.
Я могу предоставить форму, функции curl и print_r столбчатого массива и вывод результатов из завитущих соединений.
Я знаю, что единственное различие между обоими соединениями - это локальные порты, которые используются (что я нахожу странным), и тот, который работает, имеет значения d/l, где, как и тот, который не работает Значения d/l равны 0.
Тем временем я увижу, могу ли я показать вам копии всего.
$post_data2['name']=$_POST['first_name'];
$post_data2['custom_LastName1']=$_POST['last_name'];
$post_data2['email']=$_POST['email'];
$post_data2['custom_Phone']=$_POST['phone'];
$post_data2['webform_id'] = 8114201;
$post_data1=$_POST;
//create cURL connection for salesforce db
$ch1 = curl_init('https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8');
print_r($_POST);
//set options
//set options
curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch1, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, 1);
//set data to be posted
curl_setopt($ch1, CURLOPT_POSTFIELDS, $_POST);
//perform our request
curl_exec($ch1);
$result = curl_exec($ch1);
//show information regarding the request
print_r(curl_getinfo($ch1));
echo 'errors';
echo curl_errno($ch1) . '-' . curl_error($ch1);
//close the connection
curl_close($ch1);
//curl connection for getresponse db
$ch2 = curl_init('https://app.getresponse.com/add_contact_webform.html?u=8QGL');
//set options
curl_setopt($ch2, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch2, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, 1);
//set data to be posted
curl_setopt($ch2, CURLOPT_POSTFIELDS, $post_data2);
//perform our request
curl_exec($ch2);
$result = curl_exec($ch1);
//show information regarding the request
print_r(curl_getinfo($ch2));
echo curl_errno($ch2) . '-' .curl_error($ch2);
curl_close($ch2);
output including a print_r($_POST). The first curl output is the broken one, the second is the working one.
Array ([oid] => 00DF00000007QKR [first_name] => Jennifer [last_name] => Cowles [email] => [email protected] [phone] => 9286711697 [company] => NWU [Campaign_ID] => 701F0000000mimp [submit] => Yes, call me now!) Array ([url] => https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8 [content_type] => text/html;charset=UTF-8 [http_code] => 200 [header_size] => 339 [request_size] => 292 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.097856 [namelookup_time] => 2.3E-5 [connect_time] => 2.7E-5 [pretransfer_time] => 9.9E-5 [size_upload] => 909 [size_download] => 0 [speed_download] => 0 [speed_upload] => 9289 [download_content_length] => -1 [upload_content_length] => 909 [starttransfer_time] => 0.020784 [redirect_time] => 0 [certinfo] => Array () [primary_ip] => 204.14.234.45 [primary_port] => 443 [local_ip] => 10.0.2.142 [local_port] => 48534 [redirect_url] =>) errors0-Array ([url] => https://app.getresponse.com/add_contact_webform.html?u=8QGL [content_type] => text/html; charset=utf-8 [http_code] => 200 [header_size] => 815 [request_size] => 283 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.692412 [namelookup_time] => 0.009802 [connect_time] => 0.102256 [pretransfer_time] => 0.298121 [size_upload] => 590 [size_download] => 19354 [speed_download] => 27951 [speed_upload] => 852 [download_content_length] => -1 [upload_content_length] => 590 [starttransfer_time] => 0.391054 [redirect_time] => 0 [certinfo] => Array () [primary_ip] => 207.8.198.26 [primary_port] => 443 [local_ip] => 10.0.2.142 [local_port] => 37214 [redirect_url] =>) 0-
Благодаря Дженнифер Коулза
определенно понадобится дополнительная информация. Попробуйте отправить некоторые из запросов на завивки в редакторе – user2879041
Я думал, что так будет, позвольте мне посмотреть, могу ли я получить код в комментарии. По-видимому, я не могу нажать введите, я попробую отредактировать исходный вопрос –
Эта кнопка кода выше ничего не делает для меня ctrl-k, где она находится на –