[Chameleon] Problem with executeQuery

Eijnden, B. van den (Bart) b.vdeijnden at agi.rws.minvenw.nl
Fri May 19 05:06:06 EDT 2006


If you get a blank page, what does your PHP error log say?

Put log_errors On in php.ini, and set and error log file.

Best regards,
Bart

-----Oorspronkelijk bericht-----
Van: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org]Namens ventouse at free.fr
Verzonden: vrijdag 19 mei 2006 11:05
Aan: chameleon at lists.maptools.org
Onderwerp: [Chameleon] Problem with executeQuery


Hi !

I've read the tiki pages about the custom query (executequery in
query-utils.php), and I still have problems making this thing work.

Here is my code

In html main page

<script language="JavaScript" type="text/javascript">
function myOnLoad()
  {
     CWC2OnLoadFunction();
     goEventManager.registerForEvent( 'ON_QUERY', 'myOnQuery' );
  }
  </script>
<script language="JavaScript" type="text/javascript">
  function myOnQuery(nX,nY)
  {

                  var
url='query.phtml?=&x'+nX+'&y='+nY+'&sid='+document.forms[0].sid.value ;
                  window.open(url,'eventwin',width=500,height=600);
                }

And in query.phtml

// check for a session
if( !isset( $_GET[ 'sid'] ) )
   die('no session detected');

// define some vars
define("LOAD_MAPSESSION", 1);
define( 'CHAMELEON_PATH', '/ms4w/apps/chameleon/htdocs/');

// include the supporting php functions
include(CHAMELEON_PATH."widgets/session.inc.php");
include(CHAMELEON_PATH."widgets/query_utils.php");


// execute the query based on passed coords and the mapsession
$aResults = executeQuery( $oMapSession, $_GET['x'], $_GET['y'] );


   foreach( $aResults as $nLayerIdx => $aResult )
   {   echo $nLayerIdx;
       $oLayer = $oMapSession->oMap->getLayer($nLayerIdx);
       $szName = $oLayer->name;
       foreach($aResult as $aRow)

       {
               echo 'Layer Name: ' . $szName . '<br>';

       }
   }

The whole code seems to work well except i get a blank page in my result
popup
window...

The adress of the generated result.phtml seems good (eg :
http://localhost/chameleon/samples/query.phtml?=&x95&y=71&sid=446d87ea5a88b)
and the sid seem to have been transmitted (isnt't it ?).
In addition i've tried and use the usual query widget and there's no problem
getting the shape file info.
So, is it a session related problem ?

Thanx in advance

E. SEGUIN

PS : the map file code if it could be useful.

LAYER
  NAME monde

  METADATA
    "DESCRIPTION" "Syst&#1080;me G&#1081;od&#1081;sique"
    "GROUP" "Polygon"
    "LAYER" "Syst&#1080;me G&#1081;od&#1081;sique"
  END
  TYPE POLYGON
  STATUS ON
  DATA monde
  CLASS
        OUTLINECOLOR 50 50 50
             COLOR 255 255 155
    END

       TEMPLATE "dummy.html"
END # layer




_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/chameleon



Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te 
informeren. Wij adviseren u om bij twijfel over de juistheid of de 
volledigheid van de mail contact met afzender op te nemen.

This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20060519/abf48ba7/attachment.html


More information about the Chameleon mailing list