On 11/23/00 8:11 AM, Sivakatirswami wrote:

> Does anyone know if we can install MC as a CGI "engine" on WebStar on a MAC
> OS 9.0.4 server (and later, on a MAX OSX server)? I don't mean as an HTTP
> server (Webstar will do that) but to handle CGI posts from web pages?

Quick and dirty one:

- create alias of MetaCard application, named as "mc.cgi"
- place the alias in "WebSTAR:cgi-bin:" folder
- login with WebSTAR admin
- create a new action in the "Actions" tag -- Action "MC", Path
":cgi-bin:mc.cgi" (without quotes), Save it.
-  go to "MIME Mapping" tag, create a mime suffix for MC action:-
Action "MC", Suffix: ".mc", Type: "*", Creator: "*", MIME type "text/html",
save it.
- restart WebSTAR (must do this)
- launch MetaCard and create a new stack, place the following code in the
stack script.

on appleEvent class, eventID, sender
  if class & eventID <> "WWW�sdoc" then pass appleEvent
  put "----,kfor,user,pass,addr,svnm,svpt,scnm,"& \
      "ctyp,refr,Agnt,Kact,Kapt,post,meth,Kcip,"& \
      "Kfrq,Kcid,DIRE" into aeArg
      
  put "" into tmp
  repeat for each item argName in aeArg
    request appleEvent data with keyword argName
    put argname &": "& it &"<br>"& cr after tmp
  end repeat

  reply "HTTP/1.1 200 OK"& crlf & \
       "Content-type: text/html"& crlf & crlf &\
      "<html><head><title>CGI Echo Result</title></head>"&\
      "<body><b>CGI returned result test:</b><br><br>"& tmp &\
      "</body></html>"
end appleEvent

- keep the stack open and front most.

- launch your browser, type "http://yourMachineIP_or_Domain/.mc

Note: try something:
http://yourMachineIP_or_Domain/dddd/ssss/ccccc/metacard.mc?field=abc
and see what the server returned.

Have fun!

Regards,
LiangTyan Fui


> If so, where is any documentation/installation procedure/ sample scripts on
> how to do this? Thanks!
> 
> Hinduism Today
> Sivakatirswami
> Editor's Assistant/Production Manager
> www.HinduismToday.com
> www.HimalayanAcademy.com
> [EMAIL PROTECTED]
> 
> 
> Archives: http://www.mail-archive.com/[email protected]/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
> Please send bug reports to <[EMAIL PROTECTED]>, not this list.
> 


Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to