function do_post_request($url, $data, $optional_headers = null)
{
$params = array('http' => array(
'method' => 'POST',
'content' => $data
));
if ($optional_headers !== null) {
$params['http']['header'] = $optional_headers;
}
$ctx = stream_context_create($params);
$fp = @fopen($url, 'rb', false, $ctx);
if (!$fp) {
throw new Exception("Problem with $url, $php_errormsg");
}
$response = @stream_get_contents($fp);
if ($response === false) {
throw new Exception("Problem reading data from $url, $php_errormsg");
}
return $response;
}
Имеет ли массив POST:
$postdata = array(
'send_email' => $_REQUEST['send_email'],
'send_text' => $_REQUEST['send_text']);
Как получить отдельный элемент массива для отдельного PHP var?
Часть страницы обработчика данных POST:
...
$message = $_REQUEST['postdata']['send_text'];
...
Что не так?