[maplab-users] links from map to jpg

kgrootendorst at baird.com kgrootendorst at baird.com
Wed Sep 1 16:26:14 EDT 2004


Steffen, 
I've switched on some error messages, and I'm getting the following:

Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\Apache 
Group\Apache2\htdocs\maplab-2.2\projects\gmf_apps\IJC_LCC\query.phtml on 
line 189


Line 189 is the one that begins "$szReturnValue.="  below:


// loop and use key for titles
            // $Key is equal to the attribute name, which is also the 
header of column

            foreach ($aRows[0] as $key => $value)
            {
                        // The purpose of this if loop is to find the only 
attribute name we want to display

                        if (strcasecmp($key, "Long_DD") == "Long_DD" ||
                                strcasecmp($key, "Lat_DD") == "Lat_DD"||
                                strcasecmp($key, "MS_PATH2") == "MS_PATH2"
 
                $szReturnValue .= "<td bgcolor=\"E2EFF5\"><font 
face=\"Arial, Helvetica, sans-serif\" size=\"2\">".$key."</font></td>\n";
            }


I'm by no means a PHP programmer, so any tips/tricks would be greatly 
appreciated.
Thanks.

Kevin




Steffen Macke <sdteffen at web.de> 
Sent by: maplab-users-bounces at lists.maptools.org
09/01/2004 03:42 PM

To
maplab-users at lists.maptools.org
cc

Subject
Re: [maplab-users] links from map to jpg






Kevin,

> I changed the code, but the link still does not work.

Are you getting any error messages? Please check that you've switched
on as many error and warning messages in php.ini as possible.

My code snippet had a small problem (I used or instead of ||)
Could you check the snippet below.

If it's not working and you don't get any error messages, please add some 
debug code E.g. 
echo($key);
echo($xCell);

and post the results to the list.

Steffen

// loop and add a cell for each result
foreach ( $aRow as $key => $xCell ) {
  // $xCell is the attribute value, in this case,when the $key attribute 
name  
  // is equal to "Long_DD" and "Lat_DD" only display the value of 
attribute.
  if((strcasecmp($key, "Long_DD") == 0) ||
     (strcasecmp($key, "Lat_DD") == 0 )) {
     $szReturnValue .= "<td bgcolor=\"#ffffff\">".
       "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\">".     
       $xCell."</font></td>\n";
  }

  // when the attribute name is equal to MS_PATH2, hyperlink according to 
the 
  // value of attribute, the attribute value of MS_PATH2 should be simliar 
as  
  // http://localhost/photoalbum/image.jpg  
  //photoalbum folder with images is put at your web server.
  
  else if(strcasecmp($key, "MS_PATH2") == 0) {
    $szReturnValue .= "<td bgcolor=\"#ffffff\"> <a href=\"".$xCell.
      "\"> Click here to document</a></td>\n";
  }          
}

_______________________________________________
Maplab-users mailing list
Maplab-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/maplab-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/maplab-users/attachments/20040901/645bddab/attachment.htm


More information about the Maplab-users mailing list