Date:  08/21/2002 05:52:18 PM Msg ID:  000831
From:  FoxWeb Support Thread:  000816
Subject:  Re: IIS errors
The problem is that you are using the html_out variable.  This variable was used by FoxWeb 1.X to send data back to a browser.  It is also supported by FoxWeb 2.X for backward compatibility.  Basically, if html_out is populated at the end of the call FoxWeb 2.X tries to send the content of html_out.  Sending data to the browser with html_out requires that you include the "Content-type" header at the top:
 
html_out = "Content-type: text/html" + chr(10) + chr(10) + ...
 
The solution is to change the name of the variable in which you store your output.

FoxWeb Support Team
support@foxweb.com email

Sent by Jeff on 08/21/2002 09:23:43 AM:
All request enter and exit through one FWX file show below.  This file calls
the "runapp_opts.prg" which then distributes out to the
processing code containing a total of about 65,000 lines of code.
 
All returning browser content is assigned to HTML_OUT.
 
All browser content starts and ends with the HTML tags and an
effort is made to keep the all tags balanced for moving to XML
 
**********************************
** filename: runapp.fwx

 <%set defa to c:\inetsrv\scripts\fs
   cVersion = VERSION(1)
   SET EXCLUSIVE OFF
   SET TALK OFF
   SET HEADING OFF
   SET SAFETY OFF
   SET ESCAPE OFF
   SET STATUS OFF
   SET BELL OFF
   SET DELETED ON
   SET CONFIRM ON
   SET NOTIFY OFF
   SET RESOURCE OFF
   SET CURSOR OFF
   SET REPROCESS TO 2 SECONDS
   SET CENTURY ON
   SET OPTIMIZE ON
   SET EXACT ON
 
   ** these vars and setup to process everything
   cFWPath   = "\inetsrv\scripts\ac\"
   SET DEFA TO (cFWPath)
   set procedure to aud_proc
  
   cWebSiteHome  = netuse("WEBSITEHOME",.t.)
   cWebSiteName  = netuse("WEBSITENAME",.t.)
   cWebSiteTitle = netuse("WEBSITETITLE",.t.)
   cSmallLogo    = netuse("SMALL_LOGO",.t.)
   cLargeLogo    = netuse("LARGE_LOGO",.t.)
   html_out      = ""
   cUserID       = ""
   cUserPw       = ""
   cUserBran     = ""
   cTempDir      = ""
   nUserRec      = 0
   nViewCount    = 0
   cIpAddr       = ""
   cbrowser      = ""
   lMSIE         = .f.
   cJavaScript   = ""
   nUserSecurity = 0
   lLocalUser    = .f.
   lFieldRep     = .f.
   lVendor       = .f.
   cWebTempDir   = ""
   lRecordUser   = .f.
   nLogRec       = 0
   cAccess_type  = ""
   cParmSent     = ""
   cParmSent2    = ""
   cSentJobNo    = ""

   =chk_dbfs()
    
   nLogRec      = val(request.querystring("lr"))
   cParmSent   = upper(request.querystring('parm'))
   cParmSent2 = upper(request.querystring('parm2'))
   cSentJobNO = upper(request.querystring('parm3'))
   ** var for processing request
   cSentParameter = upper(cParmSent)

   DIMENSION aPostFields(1)
   aPostFields(1) = ""
   DIMENSION aPostVal(1)
   aPostVal(1) = ""
   nPostFields = 0
 
   ** pull all the formfields in first
   dimension aTPost(1,1)
   nPost= Request.FormArray(@aTPost)
   if nPost > 0
      for i = 1 to nPost
         =postfield(aTPost(i,1),aTPost(i,2) )
      next
   endif
  
   cLoginErr     = ""
   lTestQuery = .f.
   *lTestQuery = .t.
 
   if !lTestQuery
      do case
         case "CHK_LOG" $ cSentParameter
            do chk_log
         case "WELCOME" $ cSentParameter
            ** do nothing
         otherwise
            ** get the user vars
            =setup_user_vars()
      endcase
   endif

%>
     <%if lTestQuery%>
        
         <%dimension aTPost(1,1)
         nPost= Request.FormArray(@aTPost)%>
         Query String: <%response.write(request.querystring())%><br>
         Parmsent: <%response.write(cParmSent)%><br>
         Sent Form Fields : <br>
         <%for i = 1 to nPost%>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%response.write(aTPost(i,1))%>:
            <%response.write(aTPost(i,2))%><br>
         <%next%>

      <%else
 
         ** process the request
         =runapp_opts()
 
         ** send it back to the web browser
 
         html_out = "Content-type: text/html" + LF + LF + html_out
         response.write(html_out)
      endif
%>
 
*****************************************************
 
Seems a mystery then because if I comment out the line above the response.write(html_out), I get corrupted data sent the browse.  Interesting.......let me know what other information I can provide. 
 
Thanks
 
Jeff
Sent by FoxWeb Support on 08/16/2002 03:54:56 PM:
FoxWeb 2.0 automatically adds the Content-Type header, unless you override it with Response.ContentType method.  Including the content type with the Response.Write method should not make a difference and in fact it will probably cause the content type command to be displayed in the browser window.

FoxWeb Support Team
support@foxweb.com email