[mapguide-users] Problems using concat for URL Parsing

mauro1970 mgvillablanca at yahoo.com
Thu Mar 13 21:18:20 EDT 2008


URL in Mapguide: 
concat('../central_plant/sensors/send_Id.php?DeviceID=',
concat("thermostat_id", concat('&DeviceType=', concat("type_d",
concat('&PrimaryIndex=', "PRIMARYINDEX")))))



Yes I do. I get this:

array(3) { ["DeviceID"]=> string(1) "1" ["DeviceType"]=> string(10)
"thermostat" ["PrimaryIndex"]=> string(1) "1" }

Which means that the script received the attributes properly, right? In that
case what's wrong with the rest of the code?

<?php
	
	$DeviceID = $_GET["DeviceID"];
	$DeviceType = $_GET["DeviceType"];
	$PrimaryIndex = $_GET["PrimaryIndex"];	

	
?>
<html>
  <head>
    <script language="javascript" type="text/javascript">
      function OnPageLoad()
      {
       		parent.parent.mapFrame.Refresh();
      }
    </script>
  </head>
<body onLoad="OnPageLoad();">

<script language="Javascript">
	
		var Device_ID = <?= $DeviceID ?>;
		alert (Device_ID); //displays ok
		var PrimaryIndex = <?= $PrimaryIndex  ?>;
		alert (PrimaryIndex); //displays ok
		var Device_Type = <?= $DeviceType ?>;
		alert (Device_Type); //fails to display
		alert (PrimaryIndex);

</script>
</body>
</html>

Thanks Jackie.





Jackie Ng wrote:
> 
> If you var_dump($_GET) in your php script, do you get anything w/ the
> string attribute?
> 
> - Jackie
> 
> 
> mauro1970 wrote:
>> 
>> I added to this code to a layer:
>> 
>> concat('../central_plant/sensors/send_Id.php?DeviceID=',
>> concat("thermostat_id", concat('&DeviceType=', "coord_x")))
>> 
>> When Control clicking, Mapguide correctly sends out the attributes
>> "thermostat_id" and "coord_x" (both of type integer) to a script that
>> displays the variables DeviceID and DeviceType. However if I replace one
>> of the attributes with another attribute of type string, nothing is
>> displayed.
>> 
>> Any ideas as to why that happens?
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problems-using-concat-for-URL-Parsing-tp16040944s16610p16042392.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list