[mapserver-users] Echo PHP in a query template?

Bistrais, Bob Bob.Bistrais at maine.gov
Tue Oct 9 11:27:03 PDT 2012


Thanks everyone.  The original purpose was to do some error checking, and have little red comments (such as "invalid entry") on some fields based on an IF condition.  I'm finding another way to do it, which should work.

From: Lime, Steve D (DNR) [mailto:Steve.Lime at state.mn.us]
Sent: Sunday, October 07, 2012 1:11 PM
To: Brent Fraser; Bistrais, Bob
Cc: mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] Echo PHP in a query template?

Definitely not something done in MapServer proper. However, I thought with Apache you could do some process chaining/filtering. You might look at the various Apache modules (mod_filter is one) and see if there's anything there.

Steve

________________________________
From: mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org> [mapserver-users-bounces at lists.osgeo.org] on behalf of Brent Fraser [bfraser at geoanalytic.com]
Sent: Friday, October 05, 2012 9:15 PM
To: Bistrais, Bob
Cc: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Subject: Re: [mapserver-users] Echo PHP in a query template?
Bob,
Not as coded.  The template file is read by mapserver, it then makes text substitutions (eg "[username]") , and sends the result to std out.  Then the web server sends it to the browser.  The web server does not do any interpreting of the PHP in this case.

What  did you want to do?


Best Regards,

Brent Fraser
On 10/5/2012 1:32 PM, Bistrais, Bob wrote:
I am customizing a MapServer query template.  I'd like to echo back some PHP  code in the HTML template.  But the process seems to ignore the PHP part.  Here's a code example:

<!-- MapServer Template -->
<?
$test = "php test!";                         <----Set PHP variable
?>

<table>
<td align="left"><b>Your Name:</b></td></tr>
<tr>
<td><input type="text" id="username" value="[username]"/></td>
</tr>

<h3><? echo "test" ?></h3>                      <---Call PHP variable

</table>

-The PHP echo displays nothing

Is there a way to get this to work?

Thanks,
Bob Bistrais, GISP
Maine Office of Geographic Information Systems



_______________________________________________

mapserver-users mailing list

mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>

http://lists.osgeo.org/mailman/listinfo/mapserver-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121009/fe9794a3/attachment-0001.html>


More information about the mapserver-users mailing list