[ms4w-users] ms4w-users Digest, Vol 59, Issue 1, PHP Error

Aneela Sd anla at live.ca
Wed Mar 11 09:57:59 EST 2009


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

_________________________________________________________________
Reinvent how you stay in touch with the new Windows Live Messenger.
http://go.microsoft.com/?linkid=9650731
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20090311/1c472935/attachment.htm 


More information about the ms4w-users mailing list