<?php
function httpPost($url,$params) {
$postData = '';
foreach($params as $k => $v) {
$postData .= $k . '='.$v.'&';
}
rtrim($postData, '&');
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_COOKIE, "__inst={'INSTANCE':'turkey','LANG':'tr','PLATFORM':'web','ENVIRONMENT':'production'};");
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48');
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_REFERER, 'https://www.example.com/landing');
curl_setopt($ch,CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, count($postData));
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
$output=curl_exec($ch);
curl_close($ch);
return $output;
}
$params = array(
"joinNowEmail" => "fantst342423etgmail.com",
"joinNowPassword" => "sifrem45"
);
echo httpPost("https://www.example.com",$params);
?> PHP CURL POST Gönderimi hatam ne ?
0
●166
- 27-08-2018, 21:31:14Kodları böyle hazırladım ama çalışmıyor bi sorun mu var anlayan yazabilir mi