curl ile asagidaki sekilde agent gönderiyorum dışarıdaki siteme.
Fakat dışardaki siteye giden bağlantı şu şekilde.
access.log dosyası içeriği
[28/Sep/2014:23:45:52 +0400] "GET /gateway.asp?username=kullaniciadim&company=firmam& password=sifrem&action=0&message=test HTTP/1.1" 404 290 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7"
testten sonraki parametre boş gidiyor. curl_init değişken sonrasındaki stringi nasıl göstereceğimi bilemedim?
yardımlar için şimdiden teşekkürler.
<?
$reminder_details = ("test");
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://www.teknowan.com/gateway.asp?username=kullaniciadim&company=firmam& password=sifrem&action=0&message='.$reminder_detai ls.'&numbers=5427376596',
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7'
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
}
?>
curl_init ile dış siteye bağlantıda string problemi
1
●381
- 28-09-2014, 22:52:12Kimlik doğrulama veya yönetimden onay bekliyor.
- 29-09-2014, 20:00:45
<? $reminder_details = "test"; $curl = curl_init(); // Set some options - we are passing in a useragent too here curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'http://www.teknowan.com/gateway.asp?username=kullaniciadim&company=firmam&password=sifrem&action=0&message='.urlencode($reminder_details).'&numbers=5427376596', CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7' )); // Send the request & save response to $resp $resp = curl_exec($curl); // Close request to clear up some resources curl_close($curl); echo $resp; ?>
Yukarıda ilettiğim şekilde denerseniz probleminiz çözülecektir, sözdizimi hatası mevcuttu, stabil çalışacak hali yukarıdaki gibidir.