PHPMapscript

Doug Williams williams at WEBSAWYER.COM
Mon Mar 6 18:22:46 EST 2006


<?php
// copy this page in and see if you get anything
// it should at least tell you if you are loading the library

if (!extension_loaded("MapScript")){
  if (dl('php_mapscript_46.dll')) {     
    echo "<script>window.alert('success');</script>";
  }else{
    echo "<script>window.alert('failure');</script>";
  }
}else{
    echo "<script>window.alert('already loaded (i doubt it)');</script>";
}
$map_path="C:/ms4w/apps/kamap-0.1.1/htdocs/";        
$map = ms_newMapObj($map_path."global.map");
$image=$map->draw();
$image_url=$image->saveWebImage();



?>  

<? /*  as well, i don't understand why your code should return anything at all
to the browser!  You need some html in your script, like  */ ?>
<html>
<body>
this is my map
<p>
<center><img src="<? echo $image_url; ?>"></center>

<? /* you can also try something really simple to see if your script is
communicating with the library, like:  */ ?>
<p>
mapserver version: <? echo ms_getVersion(); ?>

</body>
</html>



More information about the mapserver-users mailing list