[mapguide-users] PHP script for getting data from selected item(s)

Andrew DeMerchant andrew.demerchant at gemtec.ca
Fri Jul 28 13:01:42 EDT 2006


That's out of my league too.....glad to see that this script is getting 
added to the toolset! And glad to see that it will get some use...I 
actually have since modified the original script slightly....I changed 
the lines:

echo 
'<pre>'.$ReportURL."?".$DestinationKeyName."=".$val."&".$AdditionalData.'</pre>';
header("Location: 
".$ReportURL."?".$DestinationKeyName."=".$val."&".$AdditionalData);

to :

echo '<META HTTP-EQUIV="Refresh" Content="0; URL=' . $ReportURL . "?" . 
$QueryString . $AdditionalData . '">';

I did this because in my case, I wanted to be able to resize the window 
that the ReportURL was taking the user to (based on a height / width 
variable passed in AdditionalData. And it seemed as though the header 
forwarding method was not letting that happen.....the meta method works 
well for this.

Andrew

James Card wrote:

> On Fri, 30 Jun 2006 13:36:02 -0700, Andy Morsell 
> <amorsell at spatialgis.com>  wrote:
>
>> That's awesome.  Thanks for supplying to the group.  One thing to 
>> note,  however, is the MgPropertyType for whatever the KeyName field  
>> corresponds to.  In your case, it is a string, so you are using  
>> $featureReader->GetString($KeyName).  It won't be a string in all 
>> cases,  so you may want to add a function to determine that 
>> dynamically along  the lines of what Kori had in his code yesterday: 
>> [SNIP]
>
>
> I've added a function to determine the MgPropertyType and retrieve 
> the  appropriate value. It has survived my limited testing so far, but 
> has not  been thoroughly tested yet.
>
> Also, some of the target pages we're calling (ColdFusion applications  
> built around MapGuide 6.5) are expecting values to be encapsulated in  
> single-quotes, I've added an option to leave them in. Because it 
> INCLUDEs  the constants.php file I placed it in the mapviewerphp 
> directory to make  it a standard part of our toolset.
>
> What it doesn't yet have, that I'm sure we'll need eventually, is the  
> ability to call the target page as an HTTP POST request rather than a 
> GET.  PHP has a PECL extension for HTTP functions available that might 
> make this  easy; it is not installed by default (and installation is 
> not as  straightforward as it could be), so I'd like to limit the code 
> to those  PHP functions that are included in the standard install.
>
> I don't understand HTTP well enough to have PHP send the proper 
> sequence  of headers for a POST, so I'm hoping someone here can add 
> the bit of  intelligence that's still lacking.
>
>
> ------------------------------------------------------------------------
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
>For additional commands, e-mail: users-help at mapguide.osgeo.org
>

-- 
	*Andrew DeMerchant*
*Computer Technologist*
ph.1-877-4GEMTEC x.163
fax 506-453-9470

/GEMTEC Limited <http://www.gemtec.ca>
/191 Doak Road
Fredericton, NB, Canada
E3C 2E6

-------------- next part --------------
Skipped content of type multipart/related


More information about the Mapguide-users mailing list