$_Post error

Bill Chappell bill at POCONOGIS.COM
Wed Sep 7 14:04:19 EDT 2005


Hi, I'm new to PHP and struggling with the examples in Bill Kropla's
"Beginning Mapserver" book, I'm not sure what is going on but I've tried the
example as per then book and also from my own data and I'm getting the same
error. The script does generate a png image that looks correct but errors
when it gets to the $_POST command.  

 

Any clues?

 

 

<?php

 

//------------------------------------------

// Convert from image to map coordinates

 

function img2map($width,$height,$point,$ext) {

 

   $minx = $ext->minx;

   $miny = $ext->miny;

   $maxx = $ext->maxx;

   $maxy = $ext->maxy;

 

   if ($point->x && $point->y){ 

      $x = $point->x;

      $y = $point->y;

 

      $dpp_x = ($maxx-$minx)/$width; 

      $dpp_y = ($maxy-$miny)/$height;

 

      $x = $minx + $dpp_x*$x;

      $y = $maxy - $dpp_y*$y;

   }

   $pt[0] = $x;

   $pt[1] = $y;

   return $pt;

}

//------------------------------------------

 

// Default values 

 

$script_name = "pocono.php";

 

// path defaults

 

#$map_path = "/pocono/";

$map_file = "pocono.map";

$img_path = "/tmp/";

 

// Navigation defaults

 

$zoomsize=2;

$pan="CHECKED";

$zoomout="";

$zoomin="";

 

// Displayed layer defaults

 

#$majrds = "CHECKED";   

$majrds = "CHECKED";    

$lakes = "CHECKED";               

$munibndy = "CHECKED";

$roads = "CHECKED";

$wshed = "CHECKED";

 

// Default click point

 

$clickx = 320;     

$clicky = 240;          

$clkpoint = ms_newPointObj();

$old_extent = ms_newRectObj();

 

// Default extent

 

$extent = array(2600000, 300000, 2680000, 350000);

$max_extent = ms_newRectObj();

$max_extent->setextent(2600000, 300000, 2680000, 350000);

 

// Retrieve mapfile and create a map from it

 

#$map = ms_newMapObj($map_path.$map_file);

$map = ms_newMapObj($map_file);

 

// If we've been invoked by the form, use form variables

// else drop through and create first map   

 

 

 

// I believe the error is here but I don't know what to do about it?

 

if (( $_POST['img_x'] and $_POST['img_y'] ) 

            or $_POST['refresh']) {

 

Generates a :

 

Notice: Undefined index: img_x in
C:\Inetpub\wwwroot\cgi-bin\Pocono\pocono.php on line 76

Notice: Undefined index: refresh in
C:\Inetpub\wwwroot\cgi-bin\Pocono\pocono.php on line 76

 

 

Bill Chappell

570-402-5064

Bill at PoconoGIS.com

www.PoconoGIS.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050907/41bfebb2/attachment.html


More information about the mapserver-users mailing list