<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2491" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi Aileen,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>by 'passing a variable from php to a map file' you mean
writing some parameters to the mapfile before usage (like database connetions
parameters) or modifying the mapfile object on the fly to imediat
usage?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>To write parameters you can use the install script function,
change your mapfile extension to .map.in and add the variables
replacement tags @YOUR_VARIABLE@ where they are needed. After that set a
configuration file containing the variable replacement values. Then you just
need to do a cw3setup.php --install --config-from-file
path_to_and_name_of_the_config_file</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If you need to modify the mapfile object on the fly, you can
have a look at the plugin Outline, in ServerOutline.php </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>$msMapObj = $this->serverContext->getMapObj(); this will
get you the map object</FONT></DIV>
<DIV><FONT size=2>then its just a question of using phpmapscript functions and
properties: <A
href="http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/referencemanual-all-pages">http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/referencemanual-all-pages</A></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>there are some exemple of usage in ServerOutline.php to
access, create, modify and remove elements (layers, style, class,
... )</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Regards</FONT></DIV>
<DIV><FONT size=2>Oliver</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=aileen@mapcentral.ph href="mailto:aileen@mapcentral.ph">Aileen
Baylon</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=Cartoweb-users@lists.maptools.org
href="mailto:Cartoweb-users@lists.maptools.org">Cartoweb-users@lists.maptools.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, May 11, 2006 11:46
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Cartoweb-users] passing a
variable from php to map file</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>We are having trouble passing a variable from php
to a map file.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>How do you declare this in php?</FONT></DIV>
<DIV><FONT face=Arial size=2>How do you catch this in the map
file?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>We want to pass the "source_id" & "target_id"
to the mapfile?</FONT></DIV>
<DIV><FONT face=Arial size=2>we are still on the R&D stage and we are
trying to customize the demoPlugin but with our data?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any help will be much appreciated.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Aileen</FONT></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Cartoweb-users
mailing
list<BR>Cartoweb-users@lists.maptools.org<BR>http://lists.maptools.org/mailman/listinfo/cartoweb-users<BR></BLOCKQUOTE></BODY></HTML>