[Mapserver-users] Mapserver crashing with PHP/Mapscript when...
P Wilkerson
1wilkerson at charter.net
Mon May 31 23:57:53 PDT 2004
I am modifying the GMapDumpQueryResults function in GMap75.inc of the GMap75
demo (latest version)
Mapserver stops when I add code to interact with the output from the SHP
files.
I cannot add new variables. I cannot IF statements. I cannot do much at
all without causing the application to stop.
By stopping I mean that the Mapserver program does not generate a map and
ceases outputting the rest of the HTML page.
Layer Name - layer01
There are only two fields ITEM_NBR and TITLE.
I am placing my code within the following FOR Loop of the
GMapDumpQueryResults() function.
for ($iField=0; $iField < count($selFields); $iField++)
{
< Some code in addition to mine >
< --------- start of my
code ------------------------->
// TO OUTPUT FOR THUMBNAIL
IF ($oLayer->getMetaData("DESCRIPTION") ==
"layer01") {
IF ($selFields[$iField] == "ITEM_NBR") {
$oShapeVal04 =
$oShape->values[$selFields[$iField]];
printf('%s', '<img id="thumbnail_image"
src="../data/images/imagefiles/'.$oShapeVal04.'.thumb.png"
alt="thumbnail image">');
}
}
// TO OUTPUT HREF FOR RELATED PAGE
IF (($selFields[$iField] == "TITLE") ) {
$dlconnectionstr = "http://LocalhostTest:";
$imgIDVal =
$oShape->values[$selFields[$iField]];
$dlsource = substr($imgIDVal,0,3);
if ($dlsource == "PLW") {
$dlconnectionstr =
$dlconnectionstr."PLW:";
}
ELSE
IF ($dlsource == "GAD") {
$dlconnectionstr =
$dlconnectionstr."GAD:";
}
$oShapeVal03 =
oShape->values[$selFields[$iField]];
printf('%s', '<a href="javascript:openClean(');
printf("%s", "'".$dlconnectionstr);
printf("%s", $oShapeVal03."');");
printf('">');
}
// OUTPUTS FIELD VALUE EXCEPT FOR ITEM_NBR FIELD
IF (! ($selFields[$iField] == "ITEM_NBR") )
printf("%s",
$oShape->values[$selFields[$iField]]);
// CLOSES HREF IF TITLE FIELD
IF (($selFields[$iField] == "TITLE") ) {
printf("</A>");
}
< --------- end of my code ------------------------->
< Code in addition to mine >
}
Again, the problem is that the program stops generating HTML / image files
when I start manipulating the variables.
Any suggestions?
Peter Wilkerson
More information about the MapServer-users
mailing list