Perl script as template
Zolla Michalak
michalak at hwr.arizona.edu
Thu Jun 8 13:58:08 PDT 2000
Daniel-
Here's what I'm trying to do. Take a look at the MapScript demo at
http://mapserver.gis.umn.edu/demo_init.html. My program is very similar,
except that instead of opening with the page that has the "Initialize"
button, it opens with a perl script with a map (created with perl code,
using the perl module) and a form (going to the mapserver). The form is
processed with mapserver, and the temlate file is sent to the user. Well,
to make it look slick, I made the template file look exactly the same as
the opening perl script page, with the map and form, so that it looks like
you stayed on the same page, when really you jumped from perl over to the
template.
So, wouldn't it be nice if the perl script and template could be the same
file. That way, I wouldn't need two copies of the exact same thing. I
could open up with say, mytemplate.pl, a page with a map and a form on it,
the form would go to mapserver, and pass the information back to the
template, the same page at mytemplate.pl.
I'm also working on a version that sends a form to my perl script, but I
need the functionality of the mapserver for processing the form and
dealing with variables, so rather than rewrite all that, I've combined
them.
-zm
On Thu, 8 Jun 2000, Daniel Morissette wrote:
>
> I'm not sure what you're trying to do exactly (i.e. why you need to mix
> MapServer templates and MapScript), but there is also the PHP MapScript
> module that might allow you to do what you want. Then your PHP page
> would be your HTML template and you would have access to MapScript.
>
>
> Zolla Michalak wrote:
> >
> > Hmm. Interesting idea, but I don't think that would do what I want. I need
> > the perl code because I'm using the mapscript perl module. Also, it looks
> > like the template file needs a .html extension.
> >
> > -zm
> >
> > On Thu, 8 Jun 2000, Doyon, Jean-Francois wrote:
> >
> > > I realize Perl would be nice, but have you tried some form of Parsed HTML
> > > like PHP or ColdFusion ? Might do the trick ...
> > >
> > > J.F.
> > >
> > > > ----------
> > > > From: Zolla Michalak[SMTP:michalak at hwr.arizona.edu]
> > > > Sent: Thursday, June 08, 2000 2:24 PM
> > > > To: mapserver-users at lists.gis.umn.edu
> > > > Subject: Perl script as template
> > > >
> > > >
> > > > I have a suggestion for future versions of mapserver, which I think might
> > > > be easy to implement. Correct me if I'm out to lunch.
> > > >
> > > > I would like to be able to use a perl script (which generates html) for
> > > > the template file. Looks like it is catching my file name (.pl file) at
> > > > the TEMPLATE line in the map file, and rejecting it because of its
> > > > extention even before it looks at the perl.
> > > >
> > > > Do you think this would be a possibility?
> > > >
> > > > -zolla michalak
> > > >
> > >
>
> --
> ------------------------------------------------------------
> Daniel Morissette danmo at videotron.ca
> http://pages.infinit.net/danmo/
> ------------------------------------------------------------
> Don't put for tomorrow what you can do today, because if
> you enjoy it today you can do it again tomorrow.
>
More information about the MapServer-users
mailing list