Voting

: seven minus four?
(Example: nine)

The Note You're Voting On

sorin dot andrei at mymail dot ro
20 years ago
[Editor's Note:
Serializing the object, storing it and then (on the next page) unserializing it WILL work.
End Note]

the big problem for PHP is it can't save in session an COM object

an samples code is here. This works just first time, then give the error:
Call to undefined method com::Refresh() on line $mMap->Refresh();
the reson is he can't save the object $mMap in session

<?php
session_start
();
if (isset(
$_SESSION['map'])) {
$mMap = $_SESSION['map'];
}
else
{
$ArcIMSConnector = new COM ("aims.ArcIMSConnector") or die("can not create AIMS message object");
echo
"Loaded ArcIMSConnector, <br>";
$ArcIMSConnector->ServerName = "map.sdsu.edu";
$ArcIMSConnector->ServerPort = 5300;

$mMap = new COM ("aims.Map") or die("can not create aims.Map message object");
echo
"Loaded aims.Map, <br>";
print
"AIMS-ServerName= $ArcIMSConnector->ServerName <br>";

$resultInit= $mMap->InitMap($ArcIMSConnector,"Worldgeography");

$mMap->Width = 400; // 'Width of the map in pixels
$mMap->Height = 300; // 'Height of the map in pixels
$mMap->BackColor = 15130848;
$_SESSION['map'] = $mMap;
}

$resultRefresh = $mMap->Refresh(); //Refresh the map
$urlImage = $mMap->GetImageAsUrl();
print
"<br>urlImage=$urlImage<br>";

print
"<br><IMG SRC='$urlImage'>";

/*
$ArcIMSConnector->Release();
$ArcIMSConnector = null;

$mMap->Release();
$mMap = null;
*/

?>

<< Back to user notes page

To Top