SSI/ASP PROBLEM (Query String) HELP!!!

J

Jeremy

I'm posting my message again since I've received 0 replies the first time.


In IIS5 with ASP when I try to run an SSI command:

<!--#include virtual="/asp_scripts/template.asp?section=1&sub=Main" -->

I get "404 Object Not Found" But if I remove the query string like so:

<!--#include virtual="/asp_scripts/template.asp" -->

It works just fine.

Any ideas on how to fix this problem? Time is of the essence and I
really appreciate your time and responses.

Thanks,
Jeremy
 
T

Tim Slattery

I'm posting my message again since I've received 0 replies the first time.


In IIS5 with ASP when I try to run an SSI command:

<!--#include virtual="/asp_scripts/template.asp?section=1&sub=Main" -->

I get "404 Object Not Found" But if I remove the query string like so:

I'm a bit surprised at the message, but not at the fact that this
doesn't work. The "include" directive just reads another file and
plunks it into the file currently being worked on. It does not make a
web request, which is what you are trying to do here. This simply will
not work.
 
B

Bob Barrows

Jeremy said:
I'm posting my message again since I've received 0 replies the first
time.


In IIS5 with ASP when I try to run an SSI command:

<!--#include virtual="/asp_scripts/template.asp?section=1&sub=Main"
-->

I get "404 Object Not Found" But if I remove the query string like so:

<!--#include virtual="/asp_scripts/template.asp" -->

It works just fine.

This is expected. Code in an Included page has access to the querystring of
the page in which it is Included. If the required values are not part of the
request collection of that page, then you need to use global variables in
that page which are referenced in the code in the Included page:

<%
dim strsection, strsub
strsection=1
strsub="Main"
%>

In template.asp, instead of using
request.querystring("section")

use

strsection

HTH,
Bob Barrows
 
J

Jeremy Capp

Thanks, Bob, for the reply. I guess I'm just going to have to change all
my .shtml files to .asp files so I can create these variables.

It sucks that ASP/IIS doesn't allow this.....putting query strings that
include CGI/Perl scripts via SSI works just fine.
 
J

Jeremy Capp

Tim,

I appreciate the reply. However, I've been programming in Perl for
many years and putting a query string into an include ALWAYS worked. I
guess ASP just sucks and I'll have to change all my .shtml files to .asp
files so I can create the variables to pass to the script I'm trying to
call.

Thanks again.
 
T

Tim Slattery

Jeremy Capp said:
Tim,

I appreciate the reply. However, I've been programming in Perl for
many years and putting a query string into an include ALWAYS worked. I
guess ASP just sucks and I'll have to change all my .shtml files to .asp
files so I can create the variables to pass to the script I'm trying to
call.

The SSI facility in ASP is *not* the same as anything in Perl, I'm
certain of that!

I know Perl, but I don't know of an "include" facility in that
language. I assume that you actually were submitting a web request and
catching the result in your Perl code. As you now know, ASP's
"include" doesn't work like that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top