[mapserver-users] PHP, HOW??: Returning Results to Multiple Windows
Jan Hartmann
jhart@frw.uva.nl
Wed, 17 Jul 2002 14:08:54 +0200
One way of doing this is creating a submit-form in each window, each calling
a different PHP script. If the first window has a form called Form1 (for map
results) and the second window Form2 (for query output), you can code both
forms as follows:
<form name=form1 action=<your PHP=mapserver-script> method=POST>
<input type=hidden name=extent value=...>
<...>
</form>
<form name=form2 action =<your PHP-query-result script> method=POST>
<input type=hidden name=myvariable1 value=...>
<...>
</form>
If both windows are in a frameset like:
<frameset>
<frame name=window1 src=window1.html>
<frame name=window2 src=window2.html>
</frameset>
you can send both forms to the server with this button:
<button onclick="window1.form1.submit();window2.form2.submit()">
The form variables are available to the PHP-scripts in the predefined $_POST
array (e.g. $_POST["extent"], $_POST["myvariable1"]). They can be used to
generate response pages which will be sent back to the calling windows.
Hope this helps.
Jan Hartmann
Department of Geography
University of Amsterdam
jhart@frw.uva.nl
PS In older versions of PHP the $_POST array is known as $HTTP_POST_VARS. It
does not have global scope like $_POST. The traditional way of reading FORM
variables into PHP (just using global variables with the same name, like
$extent, $myvariable1) is strongly discouraged for security reasons and will
be dropped in the future.
-----Original Message-----
From: owner-mapserver-users@lists.gis.umn.edu
[mailto:owner-mapserver-users@lists.gis.umn.edu]On Behalf Of Hankley,
Chip
Sent: Tuesday, July 16, 2002 7:14 PM
To: MapServer List (E-mail)
Subject: [mapserver-users] PHP, HOW??: Returning Results to Multiple
Windows
Kind of a generic server side processing question.
I'm running a querybypoint operation w/ PHP MapScript. I can collect the
results in an array, highlight the selected records, etc. etc., all in the
same window. BUT, what I want to do is display the selected records in a
table in a NEW window. So... I want the server-side stuff to do something
like this.
Receive Input
|
V
Query Shapefile
|
V
Return Results to Array
|
V
Refresh Map in Existing Window
(showing selected records)
|
V
Display the Attributes of
the Selected Records in a
New Window
It's this last step that I'm having a hard time with...I would think it
should be simple. Thanks for any suggestions!
Cheers!
Chip Hankley