// define variables
define( "MAPFILE", "mapnamegoeshere.map" );
define( "MODULE", "php_mapscript.so");
$lyr = $_GET['layer'];
$pieces = explode(",", $lyr);
$xx = $_GET['x'];
$yy = $_GET['y'];
$check2 = 999;
// load the mapscript module
if (!extension_loaded("php_mapscript.so")) dl(MODULE);
// open map
$oMap = ms_newMapObj( MAPFILE );
$point = ms_newPointObj();
$point->setXY($xx,$yy);
////////////////////////////////////////
foreach ($pieces as $valueX)
{
$oLayer=$oMap->getlayerbyname("$valueX");
//echo "$value
";
if(@$oLayer->queryByPoint($point, MS_SINGLE, -1) == MS_SUCCESS)
{
$oLayer->open();
$items=$oLayer->getitems();
$nResults = 0;
for($iLayer=0; $iLayer < $oMap->numlayers; $iLayer++)
{
//echo "$iLayer
";
$oLayer = $oMap->GetLayer($iLayer);
$nLayerResults = $oLayer->getNumResults();
if ($nLayerResults == 0)
continue;
$oLayer->open();
$aFields = $oLayer->getitems();
for ($iRes=0; $iRes < $nLayerResults; $iRes++)
{
$check = 1;
$oRes = $oLayer->getResult($iRes);
$oShape = $oLayer->getShape($oRes->tileindex,$oRes->shapeindex);
for($iField=0; count($aFields); $iField++)
{
if($check == 1 && $check2 != $iLayer)
{
?>
$check = 0;
}
if($check2 != $iLayer)
{
?>
values[$aFields[$iField]] . " |
";
?>
free();
$nResults++;
}
$oLayer->close();
echo "\n";
}
}
}
?>