MS2 Fatal Error: Couldn't load 'ad'


M-Script II


A CGI programming language by
Mark Morley of Islandnet
Updated: December 02, 2003
Total Visits:
Last Access:
Copyright 1997, All rights reserved
"M-Script II" is a trademark of
Islandnet AMT Solutions Group Inc.


Because M-Script II is so new, there haven't been many frequently asked questions yet. Keep an eye on this page as it expands.


As an ISP we have to be extremely cautious about allowing user-written CGIs. How does M-Script II address the common security and resource concerns?

  • M-Script II programs run under the UID and GID of the login specified in the URL. The interpreter can only execute programs stored in the same user's account. One user cannot write programs that run under another's ID unless the other user installs it into his or her account too.

  • M-Script II programs automatically change to the home directory of the login specified in the URL. All functions that accept file names ensure that they are relative to the home directory and that they do not attempt to reference files outside of their account.

  • M-Script II functions that invoke external programs (like sendmail, the pager program, the fax program, etc.) check for dangerous shell characters in parameters, eliminating a common security hole in many CGIs.

  • M-Script II does not provide a way to run external programs, except for those explicitly used by functions like mail().

  • M-Script II programs run at a slightly lower priority so that an inproperly written program can't hog the CPU and cause other things (like the web server itself) to slow down.

  • M-Script II programs can only run for a finite time before they are automatically shut down. A browser will typically time out long before this time is reached, so it doesn't interfere with normal operations. This protects against programs that may have infinite loops, etc.

  • M-Script II falls somewhere between C and Perl in terms of the amount of RAM and CPU typically used as well as speed of execution. That is, it uses more RAM and CPU than an equivalent C program, but less than the equivalent Perl program.


Why don't any of my image tags work?

Besides the obvious (the image doesn't exist, isn't a valid GIF or JPG file, etc.) the most common cause of broken images is the use of relative URLs instead of absolute ones. When a web page is generated on the fly by a CGI program, image references like:

   <img src=logo.gif>
won't work because they are relative, which means they will be relative to the URL of the CGI, not your web directory. Instead, use absolute image URLs like this:

   <img src=http://www.islandnet.com/~LOGIN/logo.gif>
You can also specify the base URL for relative references by printing a tag like this near the top of your output:

   <base href="http://www.islandnet.com/~LOGIN/">
If you do this then you can continue to use relative URLs for the rest of the output.


How do I create and access arrays?

You create and access arrays via the varget() and varset() routines. These are documented in the online guide under the Miscellaneous Functions section.