Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WWC and header
Message
De
05/03/2001 19:13:37
 
 
À
05/03/2001 18:59:50
Information générale
Forum:
Visual FoxPro
Catégorie:
West Wind Web Connection
Titre:
Divers
Thread ID:
00482023
Message ID:
00482038
Vues:
9
>>Anyone see something wrong with this code?
>
>That code looks fine as far as I can tell. But it what you do after this that is causing the problem. For the browser to display header information, it means that your response contained two HTTP headers: the first was interpreted as the header, the second was interpreted as content. Are you calling any other framework methods after your cookie code that might be adding their own header? ExpandTemplate perhaps?

Well, basically, this is about what we have for each transaction as the main entry point:
FUNCTION Process
LOCAL lcParameter, lcOutFile, lcIniFile, lcOldError

THIS.cHTMLPAGEPATH = THIS.oServer.oConfig.owwDemo.cHTMLPagePath 
THIS.cDATAPATH = THIS.oServer.oConfig.owwDemo.cDataPath 

PRIVATE Response, REQUEST, Server, Session, Process

Process = THIS
Response = THIS.oResponse
Request = THIS.oRequest
Server = THIS.oServer
Session = THIS.oSession

* This is the start of the gcHtml variable
PRIVATE gcHtml
gcHtml='< BODY BACKGROUND='+gcClient+'BACK2.JPG>'

* This is where all VFP code is executed
* gcHtml will get appended by all necessary HTML code
Do MyProgram

* At this point, we are ready to return the HTML to the WWC server
* However, let see if we have some cookie to add
IF LEN(gaCookie[1,1])>0
   LOCAL loHeader,lnCompteur
   loHeader=CREATEOBJECT('wwHTTPHeader')
   loHeader.DefaultHeader()
   FOR lnCompteur=1 TO ALEN(gaCookie,1)
      loHeader.AddCookie(gaCookie[lnCompteur,1],gaCookie[lnCompteur,2],'/')
   NEXT
   Response.ContentTypeHeader(loHeader)
ENDIF

* We don't do the standard code for a location
IF LEN(ALLTRIM(gcLocation))>0
   IF LEN(gaCookie[1,1])=0
      Response.Redirect(gcLocation)
      ELSE
      * In case we passed a cookie
      * We can't combine a cookie and a redirect
      * So, we have to call a page for one second
      P_OUT='< META HTTP-EQUIV=Refresh CONTENT="1;URL='+gcLocation+'">'+P_OUT
   ENDIF
ENDIF

* Let return the gcHtml variable to WWC
Response.Write(gcHtml)

ENDFUNC
No were are not calling ExpandEmplate.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform