I am trying to grab the contents from a form result. However, I keep getting the following message.
Warning: file_get_contents(http://a836-acris.nyc.gov/docsearch.dll/BBL) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 405 Method not allowed in /home/content/e/m/p/empireestate/html/acris.php on line 23
This is my first draft so i know its not working but was wondering if someone can give me a few pointers.
<?php
$URL = 'http://a836-acris.nyc.gov/Scripts/DocSearch.dll/BBL';
$postdata = http_build_query(
array(
'hid_borough' => '1',
'hid_block' => '995',
'hid_lot' => '1',
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://a836-acris.nyc.gov/docsearch.dll/BBL', false, $context);
?>