[maplab-users] linking

rosy sakura whitesakura81 at yahoo.com
Tue Feb 15 13:16:30 EST 2005

hi .. i am new here .. i studied the arcview 8.1 to
make a layer for hyperlink. and my data in attribute
are below.. i only add URL attribute

 Fid | Shape | Id | URL |
   0 | Point |  0 | http://www.yahoo.com
   1 | Point |  1 | http://www.yahoo.com

And i also use this php script in 

I modify this script according to list mailing list on
september 2  2004.. 
The Problem is .. nothing change in my map in
maplab..i am using maplab2.2 and mapserver 4 ..

 I am hoping somebody will correct me if i am wrong.. 

 //************************************* ADDED FOR
// 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, "Id") == "Id"||
		  strcasecmp($key, "URL") == "URL")
	$szReturnValue = $szReturnValue.
                   "<td bgcolor=\"E2EFF5\">".
                    "<font face=\"Arial, Helvetica,
sans-serif\" size=\"2\">".                 



 $szReturnValue .= "</tr>\n";

        // loop through the results and format each
            foreach ( $aRows as $aRow )
        // add a row for each
        $szReturnValue .= "<tr>\n";

//***********ADDED FOR

                // loop and add a cell for each result
                foreach ( $aRow as $xCell )
		// $xCell is the attribute value, in this case,when
the $key attribute name is equal to "Id" only display
the value of attribute.

		if (strcasecmp($key, "Id") == "Id")
                {$szReturnValue .= "<td
bgcolor=\"#ffffff\"><font face=\"Arial, Helvetica,
sans-serif\" size=\"2\">". $xCell."</font></td>\n";}

		//when the attribute name is equal to URL, hyperlink
according to the value of attribute, the attribute
value of URL should be simliar as http://... 
		//photoalbum folder with images is put at your web

		else if (strcasecmp($key, "URL") == "URL")
			{$szReturnValue .= "<td bgcolor=\"#ffffff\"> <a
href=\"".$xCell."\"> Click here to
                $szReturnValue .= "</tr>\n";



learn to control instict will develop the ability itself...( )

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Maplab-users mailing list