Raymond E. Griffith wrote/ schreef:
> I have been wrestling with the POST command for some time now with little
> success.
>
> Here is what I want to do. I want to have a MetaCard/Revolution program sent
> a POST to a URL containing field data. The URL is a CGI that should receive
> the data and email it back to me.
>
> Is this so hard to do?
Difficulty is relative, but... I think its absolutely doable:
WARNING: This is from the top of my head, so...
----------------
The CGI script:
----------------
#!/usr/bin/mc
on startup
# first make an array qParameter with all the arguments
# as key
set itemdel to "="
put replaceText($QUERY_STRING,"&",return) into tQuery
repeat with i = 1 to the number of lines in tQuery
put urlDecode(item 2 of line i of tQuery) into qParameter[item 1 of line
i of tQuery]
end repeat
# store the mail body in a temporary file
put qParameter["message"] into url "file:email.txt"
# generate the shell to be executed
put "mail -s" && quote & qParameter["subject"] & quote && qParameter["to"]
&& "< email.txt" into eCommand
# execute the mail command
put shell(eCommand) into buffer
#write minimal set of HTTP headers to stdout
put "Content-Type: text/plain" & cr
put "Content-Length:" && the length of buffer & cr & cr
put buffer
end startup
----------------
The MC script:
----------------
post "message=" & urlEncode(field "message body") & "&to=" & urlEncode(field
"to") & "&subject=" & urlEncode(field "subject") to
"http://www.mctools.org/~rgriffit/sendmail.cgi"
answer it
Or something like this...
> I'm having a hard time not saying bad words over my lack of success.
> *&%%$**!!!
>
> Any kind suggestions would be appreciated.
>
> Raymond
Hope this helps,
Sjoerd
Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.