Help outputting asp file results to physical html file

I'm using the following code I obtained from another EE solution but it is not doing what I need. The asp file I'mtrying to output uses two session variables in a select statement that drives its results. I know the session variables are not null but obviously this technique ignores them. Can anyone suggest a way for me to output the results where the session variables are identified , OR I pass a querystring, OR the code is resident in the actual file I am trying to output?
ta
Verdy


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
     Const ForWriting = 2
     Const ForReading = 1
     Const OVERWRITE = True
     
     DIM objFSO
     DIM objTextStream
     Dim objSvrHTTP
     Dim strHTML

session("PID") = 203
session("NEXTREVIEW") = 4
     
'     Set objSvrHTTP = Server.CreateObject("Msxml2.Server.XMLHTTP.4.0")
     Set objSvrHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
     objSvrHTTP.open "GET", "http://localhost/ll/doc_interview/followup_letter.asp", false

'    objSvrHTTP.open "GET", "http://www.yoursite.com/yourfile.asp", false
      
     objSvrHTTP.send

     strHTML = objSvrHTTP.responseText
     strFileName = "Letter.htm"

     '--- NOW USE FILE SYSTEM OBJECT TO SAVE TO FILE ----
     
     Set objFSO = CreateObject("Scripting.FileSystemObject")
     
     '--- OPEN TEXTSTREAM OBJ FOR WRITING, OVERWRITE EXISTING FILE (IF ANY) ---
     
     Set objTextStream = objFSO.OpenTextFile(Server.MapPath(strFileName), _
                                   ForWriting, OVERWRITE)
     
     '--- WRITE STRING TO FILE ---
     objTextStream.Write strHTML
     
     '--- CLOSE AND RELEASE OBJECTS ---
     objTextStream.Close
     set objTextStream = nothing
     set objFSO = nothing

%>
verdanteAsked:
Who is Participating?
 
joeposter649Commented:
You can't do that with session variables.  
There are two different sessions here...
1 between a browser and IIS that is serving the posted code.
1 between Msxml2 http://localhost/ll/doc_interview/followup_letter.asp

If followup_letter.asp is in the same IIS application you can use server.transfer or server.execute...
http://www.w3schools.com/asp/met_transfer.asp
Otherwise, pass the values in the querystring using "get"
or "post" the values...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmobjXMLDOMServerXMLHTTP_using_directly.asp
0
 
rdivilbissCommented:
I'm not sure you can say he can't do that give he isn't doing *anything* with the sesion variables given the code he posted.

e.g. they are not used anywhere for any purpose per what he posted.

verdante,

Can you clarify where the session variables are to be used?  As your code exists above you are not doing anything with them.

Regards,
Rod
0
 
joeposter649Commented:
They said "The asp file I'mtrying to output uses two session variables in a select statement that drives its results".  I think it's safe to assume they're talking about  "http://localhost/ll/doc_interview/followup_letter.asp" using the session variables that are being set in the code posted.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
rdivilbissCommented:
You are welcome to assume.  However if the Seeion variables are not being used the way you think, the information provided may not solve the problem.

What if it was meant to be used like this?

http://localhost/ll/doc_interview/followup_letter.asp?pid=203&nextrevie=4

Regards,
Rod

0
 
joeposter649Commented:
I see what you're saying but you always have to start with some assumptions.

>>the information provided may not solve the problem.<<
Happens far too often! :)

>>What if it was meant to be used like this?<<
One of my solutions was to pass the values in the querystring using "get".
0
 
verdanteAuthor Commented:
Thanks for the conversation over session variables. joep made judicious and correct assumptions. However I can also see why rd saw something strange with the code which unfortunately had some session variable clutter leftover from testing. So based on the assumptions can you please confirm that (objSvrHTTP.open "GET") allows me to pass a querystring in the URL. If the answer is 'yes' that solves my problem.

ta
Verdy

0
 
joeposter649Commented:
Yes, you can inlcude a querystring in the URL.  
0
 
verdanteAuthor Commented:
Thank you
Verdy
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.