- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
private function http_post($url, $post_string) {
// add any additional curl options here
$options = array(CURLOPT_URL => $url,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $post_string,
CURLOPT_USERAGENT => "PubSubHubbub-Publisher-PHP/1.0");
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
$this->last_response = $response;
$info = curl_getinfo($ch);
curl_close($ch);
// all good
if ($info['http_code'] == 204)
return true;
return false;
}
Я же говорю что PHP выпрямит извилины у кого угодно
Что не так в волшебном числе?
Что не так в хеше вместо объекта?
Да нет, ничего
define('OK', 204);
if ($info->httpCode() == OK)
204 это нихуя не ок
это ж ебануться можно насколько можно не знать свою область
if ($info->httpCode() == NO_RESPONSE)
Server has received the request but there is no information to send back, and the client should stay in the same document view. This is mainly to allow input for scripts without changing the document at the same time.
пиздец успех...
там есть контекст. можно отправить и post