<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<div>Hello Jeff,</div><div><br></div><div>Thank you for your help. My problem was solved in 1 minute. </div><div><br></div><div>Aneela.</div><div><br></div>> Message: 2<br>> Date: Tue, 10 Mar 2009 12:06:58 -0400<br>> From: Jeff McKenna <jmckenna@gatewaygeomatics.com><br>> Subject: Re: [ms4w-users] php file error<br>> To: ms4w-users@lists.maptools.org<br>> Message-ID: <49B69022.9030303@gatewaygeomatics.com><br>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>> <br>> Aneela wrote:<br>>> Hello everyone! In ms4w 5.2.1, I created & saved the following file as <br>>> phpms_hello.php<br>>> <?php<br>>> // Create a unique image name every time through<br>>> $image_name = sprintf("phpms_hello%0.6d",rand(0,999999)).".jpg";<br>>> // Create a new instance of a map object<br>>> $map = ms_newMapObj("/ms4w/Apache/htdocs/hello.map");<br>>> // Create an image of the map and save it to disk<br>>> $image=$map->draw();<br>>> $image->saveImage("/ms4w/tmp/ms_tmp/".$image_name);<br>>> ?><br>>> <html><br>>> <head><title>PHP Mapscript Hello World</title></head><br>>> <body><br>>> <form action="phpms_hello.php" method="POST"><br>>> <input type="image" name="img"<br>>> src="/ms_tmp/<?php echo $image_name; ?>"><br>>> </form><br>>> </body><br>>> </html><br>>> When I run this file in the browser, I get the following error message, <br>>> Fatal error: Call to undefined function ms_newMapObj() <br>>> in C:\ms4w\Apache\htdocs\phpms_hello.php on line 5**<br>>> ** <br>>> N.B: The hello.map file works through an html file. Can anyone help?<br>>> <br>> <br>> Hello,<br>> <br>> You need to load the mapscript module. You can see an example in: <br>> /ms4w/Apache/htdocs/quickmap.php<br>> <br>> -jeff<br>> <br>> -- <br>> Jeff McKenna<br>> FOSS4G Consulting and Training Services<br>> http://www.gatewaygeomatics.com/<br>> <br>> <br>> <br>> <br>> <br>> ------------------------------<br>> <br>> _______________________________________________<br>> ms4w-users mailing list<br>> ms4w-users@lists.maptools.org<br>> http://lists.maptools.org/mailman/listinfo/ms4w-users<br>> <br>> <br>> End of ms4w-users Digest, Vol 59, Issue 1<br>> *****************************************<br><br /><hr />Communicate, update and plan on Windows Live Messenger. <a href='http://go.microsoft.com/?linkid=9650731' target='_new'>Get started today.</a></body>
</html>