LiangTyan Fui a �crit :
> 
> On 11/11/00 7:43 PM, Pierre Sahores wrote:
> 
> > Hi anybody,
> >
> > Does anyone use the win32 cmc.exe engine and if yes, what is the right config
> > to use to get .mt scripts running (WinNT 4 sp5) with both Apache and IIS4
> > httpds  ?
> 
> I've just tested it a few days ago with IIS3 on NT4.0 sp6.
> Pretty good I would said, but I am still yet to find out more on how I can
> build a complex CGI solution on NT (calling library, build re-usable
> scripts)
> 
> Read Chapter 10 on the NT IIS configuration page, it shows you all you need
> to get the CGI works. Remember to place cmc.exe on a "clean" directory,
> excluding any of the MetaCard appl or stacks.

Thank's. I'm new to win32 (MacOS and Linux prefered).

> 
> I wish the similar engine can be built for Mac OS 9, but since OS X is
> coming .....

You can use the regular mc engine in using appleevents to speak directly with
webstar, ASIP or quidproquo.

Just put this kind of script in the card of your test stack :

on appleEvent class,event,sender
  if class & event is "WWWsdoc" then
   # get PopToFront ("MSTD") -- uncomment if the PopToFront XCMD is used
    global PostIn,Retour,Debut
    put the long seconds into Debut
    set twelveHourTime to false
    # request appleEvent data with keyword "scnm"
    # put "script name:" && it & cr after exAE
    # request appleEvent data with keyword "Kapt"
    # put "action path:" && it & cr after exAE
    request appleEvent data with keyword "meth"
    put "HTTP method:" && it & cr after exAE
    # request appleEvent data with keyword "Kact"
    # put "action:" && it & cr after exAE
    # request appleEvent data with keyword "svnm"
    # put "server name:" && it & cr after exAE
    # request appleEvent data with keyword "svpt"
    # put "server port:" && it & cr after exAE
    # request appleEvent data -- get the direct parameter
    # put "path args:" && it & cr after exAE
    request appleEvent data with keyword "kfor"
    put "search args:" && it & cr after exAE
    request appleEvent data with keyword "post"
    put "post args:" && it & cr after exAE
    put urlDecode(it) into PostIn
    # request appleEvent data with keyword "addr"
    # put "client adress:" && it & cr after exAE
    # request appleEvent data with keyword "user"
    # put "user name:" && it & cr after exAE
    # request appleEvent data with keyword "pass"
    # put "password:" && it & cr after exAE
    # request appleEvent data with keyword "frmu"
    # put "from user:" && it & cr after exAE
    request appleEvent data with keyword "Agnt"
    put "user agent:" && it & cr after exAE
    # request appleEvent data with keyword "Kcip"
    # put "client ip:" && it & cr after exAE
    # request appleEvent data with keyword "refr"
    # put "referer:" && it & cr after exAE
    # request appleEvent data with keyword "ctyp"
    # put "content type:" && it & cr after exAE
    # request appleEvent data with keyword "Kfrq"
    # put cr & "full request :" && it & cr after exAE
    if exAE contains "HTTP method: GET" then
      put "<HTML><HEAD><TITLE>ERROR: File Not Found</TITLE></HEAD>" & \
          "<BODY background='/gif/fond-maison.gif'><H1>File Not Found</H1><P>" &
\
          "<H3>The file you have requested does not exist on this
server.</H3></BODY></HTML>" into Retour
      reply "HTTP/1.0 200 OK" & cr & "MIME-Version: 1.0" & cr & "Content-Type:
text/html" & cr & "Content-Length: " & length(Retour) & cr & cr & Retour
     # get PopToFront ("WWW")
      exit appleEvent
    else
      doswitcher
      reply "HTTP/1.0 200 OK" & cr & "MIME-Version: 1.0" & cr & "Content-Type:
text/html" & cr & "Content-Length: " & length(Retour) & cr & cr & Retour
     # get PopToFront ("WWW") -- uncomment if the PopToFront XCMD is used
      exit appleEvent
    end if
  else pass appleEvent
end appleEvent

and this kind in the stack script :

on doswitcher
  global PostIn,Retour
  set itemDelimiter to "&"
  if PostIn contains "ADM=" then
    if "deburos" is in PostIn then
      if "MAJ=reload" is in PostIn
      then LoadAgain
      else if "MAJ=stopit" is in PostIn
      then StopIt
      else send ComTest to btn "ECN"
    end if
  else if char 1 to 4 of item 1 of PostIn is "arr="
  then send MrlDispatch to btn "MRL"
  else if char 1 to 6 of item 1 of PostIn is "ia932=" -- down
  then send IA931 to btn "Project" of stack "ia932"-- down
  else if item 1 of PostIn is "ecn=1"
  then send ComGo to btn "ECN"
  else if item 1 of PostIn is "ecn=2" then
    if PostIn contains "Retour=Page pr�c�dente"
    then send ComRetour to btn "ECN"
    else if PostIn contains "Suite=Page suivante"
    then send ComSuite to btn "ECN"
    else if PostIn contains "PBC=Editer le bon de commande"
    then send ComBC to btn "ECN"
    else if item 5 of PostIn contains "TDR="
    then send ComGo to btn "ECN"
    else send ComTest to btn "ECN"
  else if item 1 of PostIn is "ecn=3"
  then send ComTest to btn "ECN"
  else if item 1 of PostIn is "ecn=4"
  then send ComTest to btn "ECN"
  else if item 1 of PostIn is "ecn=5"
  then send ComStock to btn "ECN"
  else if item 1 of PostIn is "jeu=1" then
    if "jeu11" is in item 2 of PostIn
    then send Jeu11 to btn "Jeu2"
    else send Jeu1 to btn "Jeu"
  else if item 1 of PostIn is "jeu=2"
  then send Jeu2 to btn "Jeu"
  else if item 1 of PostIn is "jeu=3" then
    if "jeu18" is in item 2 of PostIn
    then send Jeu18 to btn "Jeu2"
    else if "jeu13" is in item 2 of PostIn
    then send Jeu13 to btn "Jeu2"
    else if "jeu8" is in item 2 of PostIn
    then send Jeu8 to btn "Jeu"
    else send Jeu3 to btn "Jeu"
  else if item 1 of PostIn is "jeu=4" then
    if last char of Postin is "M"
    then send Jeu4M to btn "Jeu"
    else send Jeu4D to btn "Jeu"
  else if item 1 of PostIn is "jeu=5"
  then send Jeu5 to btn "Jeu"
  else if item 1 of PostIn is "jeu=6"
  then send Jeu1 to btn "Jeu"
  else if item 1 of PostIn is "jeu=7"
  then send Jeu7 to btn "Jeu"
  else if item 1 of PostIn is "jeu=9"
  then send Jeu9 to btn "Jeu"
  else if item 1 of PostIn is "jeu=10"
  then send Jeu10 to btn "Jeu"
  else if item 1 of PostIn is "jeu=11" then
    if number of items of PostIn is "11"
    then send Jeu1 to btn "Jeu"
    else send Jeu11 to btn "Jeu2"
  else if item 1 of PostIn is "jeu=12"
  then send Jeu12 to btn "Jeu2"
  else if item 1 of PostIn is "jeu=13"
  then send Jeu13 to btn "Jeu2"
  else if item 1 of PostIn is "jeu=14" then
    if last char of Postin is "M"
    then send Jeu14M to btn "Jeu2"
    else send Jeu14D to btn "Jeu2"
  else if item 1 of PostIn is "jeu=15"
  then send Jeu15 to btn "Jeu2"
  else if item 1 of PostIn is "jeu=17"
  then send Jeu17 to btn "Jeu2"
  else if item 1 of PostIn is "jeu=18"
  then send Jeu18 to btn "Jeu2"
  else if item 1 of PostIn is "jeu=19"
  then send Jeu19 to btn "Jeu2"
  else if item 1 of PostIn is "jeu=20"
  then send Jeu20 to btn "Jeu2"
  if platform() is "Linux" and opensockets() is empty
  then put "Content-Type: text/html" & cr & "Content-Length:" && the length of
Retour & cr & cr & Retour
end doswitcher

With MacOS X, you will be able to replace appleevents by a sockets listener
(tested under Linux and WinNT using PHP) or by the new "waitformessage" built-in
function (mc 2.32 - not tested for yet).

Regards, Pierre

> 
> Regards,
> LiangTyan Fui
> 
> > Thank's for the help !
> >
> > Pierre Sahores
> >
> > chef de projet cyberlibrairie
> > SNPIN - CNDP. 91, rue Gabriel-Peri
> > 92120 Montrouge. T�l.: 01.64.45.05.33
> >
> > Penser la part du r�ve et
> > produire l'avantage comp�titif.
> >
> > 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.

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