我有以下代码
<?php
function send_post($url,$data) {//sends data array(param=>val,...) to the page $url in post method and returns the reply string
$post = http_build_query($data);
$context = stream_context_create(array("http"=>array(
"method" => "POST",
"header" => "Content-Type: application/x-www-form-urlencoded\r\n"."Content-Length: ". strlen($post) . "\r\nUser-agent:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)r\n",
"content" => $post,
)));
$page = file_get_contents($url, false, $context);
return $page;
}
$post_data=array();
$post_data['firstName'] = 'Name';
$post_data['lccp_trnno']='16348';
$post_data['lccp_month'] = '8';
$post_data['lccp_day']='12';
$post_data['lccp_srccode']='ktym';
$post_data['lccp_dstncode']='tvc';
$post_data['lccp_classopt']='1A';
$post_data['lccp_conc']='ZZZZZZ';
$post_data['lccp_age']='30';
echo send_post("http://www.indianrail.gov.in/cgi_bin/inet_frenq_cgi.cgi",$post_data);
?>
查询产生一个带有消息的页面
access violation, reason mask=!XB, virtual address=!XH, PC=!X
显然问题不在于我的代码。请求在他们的页面中创建了某种类型的错误。有人知道这是什么类型的错误及其原因,以及如何做一个工作请求来避免错误?