mhonarc-users

Re: posting from a message via a cgi script

1999-06-04 15:37:53
On June 4, 1999 at 12:34, Yu Wei Jian wrote:

The mechanism may be:

On a message page layout,  an explicit "Reply" button/link (may locate at
the right 
of the message title/subject or the bottom of the message)  is added.
After the reader
reads this message, he/she may click the "Reply" button/link, then
redirect/link to another  
web page including a mail form. This form may contain the content of some
fields 
such as To, From, Subject, and the original message,  which should be
obtained from
the Mhonarc. When the reader finish this form, he/she may click the
"Submit" botton to
invoke the CGI/Perl to work.

To create the link, you will utilize the various resource variables
within a message page layout resource to create the link.  Here is an
example:

<A 
HREF="/cgi-bin/reply.cgi?to=$FROMADDR:U$&subject=$SUBJECTNA:U$&in-reply-to=$MSGID:U$&arcloc=$OUTDIR:U$&msgfile=$MSG:U$">Reply</A>

This is an example, so the actual URL to the CGI program, and the arguments
will vary depending on your setup.  The "$XXX$" are the resource variables.
MHonArc will expand these to the appropriate values when generating a
message page.  The ":U" in the resource variable tells mhonarc to treat
the expanded value as part of a URL string.

Since the desire is to include the body of the message to reply to,
that example "arcloc" and "msgfile" arguments are to tell the CGI
program where the referenced message is located.  The CGI program will
then have to open that message file, parse out the message body
portion, strip out the HTML markup, and then include it in the CGI mail
form.

Isolating the message body of a MHonArc message page can be done by
grabbing everything within the following comment declarations:

    <!--X-Body-of-Message-->
and
    <!--X-Body-of-Message-End-->

Stripping out the HTML tags is an excersise I leave to the reader :-)

For more information, see the following sections of the documentation:

    "Page Layout"
    "Resource Variables"

--ewh

<Prev in Thread] Current Thread [Next in Thread>