20.04.2014, 17:12
function _utils_post($url, $params)
{
$contextParams = array();
$contextParams['http'] = array();
$contextParams['http']['method'] = 'POST';
$contextParams['http']['content'] = http_build_query($params);
$context = stream_context_create($contextParams);
$fp = fopen($url, 'rb', false, $context); //244 error
$response = stream_get_contents($fp); //245 error
fclose($fp); // 246 error
return $response;
}
errors are red
Warning: fopen(http://www.cleverbot.com/webservicemin) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/server/public_html/server/chatterbotapi.php on line 254
Warning: stream_get_contents() expects parameter 1 to be resource, boolean given in /home/server/public_html/server/chatterbotapi.php on line 255
Warning: fclose() expects parameter 1 to be resource, boolean given in /home/server/public_html/server/chatterbotapi.php on line 256
Cleverbot:
how to fix this please?
{
$contextParams = array();
$contextParams['http'] = array();
$contextParams['http']['method'] = 'POST';
$contextParams['http']['content'] = http_build_query($params);
$context = stream_context_create($contextParams);
$fp = fopen($url, 'rb', false, $context); //244 error
$response = stream_get_contents($fp); //245 error
fclose($fp); // 246 error
return $response;
}
errors are red
Warning: fopen(http://www.cleverbot.com/webservicemin) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/server/public_html/server/chatterbotapi.php on line 254
Warning: stream_get_contents() expects parameter 1 to be resource, boolean given in /home/server/public_html/server/chatterbotapi.php on line 255
Warning: fclose() expects parameter 1 to be resource, boolean given in /home/server/public_html/server/chatterbotapi.php on line 256
Cleverbot:
how to fix this please?