Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect

Status
Not open for further replies.

DonP

IS-IT--Management
Jul 20, 2000
684
US
I wrote this simple little script that writes a few lines of code to an HTML file. When it's finished, I want it to redirect to another script, but instead it is printing the redirect statement to the screen. How can I make it simply complete the writing, then redirect properly? Must be the "set" statements, but I'm not sure how else to do them.

[tt]<% Set FileStreamObject = CreateObject(&quot;Scripting.FileSystemObject&quot;)

Set WriteStream=FileStreamObject.OpenTextFile(&quot;changed.html&quot;,8,True)
WriteStream.Write(now())

WriteStream.WriteLine(&quot;<BR>&quot;)
WriteStream.WriteLine(&quot;The following record has been changed or added:&quot; + &quot;<BR>&quot;)
WriteStream.WriteLine(&quot;Record ID: &quot;+request.QueryString(&quot;ID&quot;)+&quot;<BR>&quot;)
WriteStream.WriteLine(&quot;For: &quot;+request.QueryString(&quot;Agency&quot;)+&quot;<BR>&quot;)
WriteStream.Close%>

Response.Redirect(&quot;search_records.asp&quot;)
Response.End%>[/tt]

Don
don@ctagroup.org
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT (only when I have to!)
 
Never mind! I realized that all I needed to do was to put this code into the script to which I was trying to redirect. With a couple &quot;If&quot; statements, the one script does it all. (Of course, there was a typo that was making it write to the screen as it was.)

Don
don@ctagroup.org
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT (only when I have to!)
 
In VBScript, you concentate strings using the & symbol not the plus symbol. I think somehow you still have a write object open.

Also, on a side note you should do this:
set FileSystemObject = nothing
when you're done with it Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Thanks for the reply! Yes, I know, but that little code was taken from an existing one and it is working just fine so, except for changing the values, I left it alone. The main problems was that I had closed the VBscript prematurely. I added a line or two of code, forgetting to move the %> too.

Don
don@ctagroup.org
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT (only when I have to!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top