Please can you helpme rewrite this code to bypass the the User-Agent http header in this code. I have been getting the error "failed to open stream: HTTP request failed" I need to stop the error when I run the code. Please find part of the script below: If you nee more information please let me know
function runapp($dir,$latdeg,$latmin,$latsec,$longdeg,$longmin,$longsec)
{
global $_english;
$query= ($_english ? 'http://esnig.org/cgi-bin/ntv2_geo2_e.cgi' : 'http://esnig.org/cgi-bin/ntv2_geo2_f.cgi').
'?' . PAR_DIR .'=' . $dir .
'&' . PAR_LATDEG .'=' . $latdeg .
'&' . PAR_LATMIN .'=' . $latmin .
'&' . PAR_LATSEC .'=' . $latsec .
'&' . PAR_LONGDEG .'=' . $longdeg .
'&' . PAR_LONGMIN .'=' . $longmin .
'&' . PAR_LONGSEC .'=' . $longsec;
$response=file($query);
foreach ($response as $value)
{
echo $value;
}
}
?>