• Subject: Re: Problems writing persistent CGI
  • From: Mel Rothman <melrothman@xxxxxxxx>
  • Date: Mon, 10 Apr 2000 15:21:00 -0500

Bob, the Accept-HTSession: directive has to be one of the HTTP headers. 
The following, where xxxxxxxxxxxxx is the session ID, works for me:

Accept-HTSession: xxxxxxxxxxxxx
Content-type: text/html        
                               
<HTML>                         
...
rest of HTML


Hope this helps.

Mel Rothman




Bob Clark wrote:
> 
> I posted this to the Ignite list earlier today.  Was wondering if anyone
> on this list might have a suggestion.
> 
> I'm trying to write my first Persistent CGI program in RPGLE.  It
> appears as if the links in my resulting Web page have the handle
> embedded in them correctly, but the Accept-HTSession: directive is
> appearing as plain text in the first line of the page.  I am writing
> this directive to standard output before I write anything else(including
> header information).  I have included the a snippet from my program,
> maybe someone can tell me what I am doing wrong?
> 
> C     $Main         BEGSR
>  *
>  *
> C     USERID        CHAIN     INTUSRRD
>  *
> C                   IF        (not %found) or (PASSWORD <> IUPWD)
> C                   eval      WrtMbr = 'HEADER    '
> C                   CALLP     #WrtSrcMbr(WrtLib : WrtFil : WrtMbr)
> *#WRTSRCMBR procedure writes static HTML to from a source member
> C                   eval      WrtDta=
> C                             '<center>' +
> C                             'ERROR!' +
> C                             '<br>' +
> C                             'Invalid User ID or Password!' +
> C                             '</center>' +
> C                             NewLine
> C                   else
> C                   if        (IUSTAT <> ' ')
> C                   eval      WrtMbr = 'HEADER    '
> C                   CALLP     #WrtSrcMbr(WrtLib : WrtFil : WrtMbr)
> C                   eval      WrtDta=
> C                             '<html>' +
> C                             '<center>' +
> C                             '<font size="+2">' +
> C                             'Welcome ' +
> C                             %trim(IUFNAM) + ' ' +
> C                             %trim(IULNAM) + ',' +
> C                             '<br><br>' +
> C                             'We are sorry, but your account'+'<br>'+
> C                             ' has not been activated yet.' +
> C                             '  Please try back later.' +
> C                             '</font>' +
> C                             NewLine
> C                   else
> C                   EXSR      GetDate
> C                   EXSR      MakeHandle
> C                   eval      WrtDta = 'Accept-HTSession:' +
> C                             %trim(Handle) + NewLine
> C                   EXSR      $WrtStout
> C                   eval      WrtMbr = 'HEADER    '
> C                   CALLP     #WrtSrcMbr(WrtLib : WrtFil : WrtMbr)
> C                   eval      WrtDta = '<html>' +
> C                             '<center>' +
> C                             '<font size="+2">' +
> C                             'Welcome ' +
> C                             %trim(IUFNAM) + ' ' +
> C                             %trim(IULNAM) + ',' +
> C                             '</font>' +
> C                             '<br><br>' +
> C                             '<a href="/cgi-bin/items.pgm/' +
> C                             %trim(Handle) +
> C                             '?userid=' +
> C                             %trim(IUUSID) + '">' +
> C                             'Go Shopping!' + '</a>' +
> C                             '</center>' +
> C                             '</html>' +
> C                             NewLine
> C                   endif
> C                   ENDIF
>  *
> C                   EXSR      $WrtStout
> 
> --
> Bob Clark
> Programmer/Analyst
> U.S. Safety
> 8101 Lenexa Dr.
> Lenexa Ks  66214
> Phone: (800) 821-5218 ext. 274
> Fax: (603) 761-6978
> +---
> | This is the Midrange System Mailing List!
> | To submit a new message, send your mail to MIDRANGE-L@midrange.com.
> | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
> | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator: david@midrange.com
> +---
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.