[mapserver-users] Re: php mapscript objects in session?

jim white jbw2003 at earthlink.net
Fri Nov 21 12:19:10 EST 2008


Hi-
> I'm using ms4w 2.2.7 and I've run into a problem. Ideally I'd like to
> create the MapScript map object and store it in the session:
>
> $_SESSION['map'] = ms_newMapObj($getMapPath);
>
> This works fine for the that page, for the first call, but when I
> attempt to reference it later I get a PHP error:
> Fatal error: Object has an invalid _handle_ property
>
> Am I missing something here?
>
> Thanks,
> -Chris

Chris,


When you attempt to start a session, you need to load the class definition first. For example

<?php 
require('myclass.php');
session_start();
?>

Jim



-- 
James (Jim) B. White
tel: (919)-380-9615
homepage: http://jimserver.net/ 



More information about the mapserver-users mailing list