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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

including variable page 2

Status
Not open for further replies.

bikh

Programmer
May 3, 2002
25
US
I have an asp page, that I want to insert other html pages in. The html pages are varried, depending on a variable I pass to the asp page.

I have tried the following which I saw in a thread on this forum:

<%
dim page
page = request.querystring (&quot;page&quot;)
%>

<!--#include virtual=<%=page%> -->

but I kept getting an error that the page &quot;<%=page%>&quot; could not be found.

Could anyone point me in the right direction?
 
thanks for the input, but it did't work

I don't get an error anymore, but I also don't get anything.

The source code will show the right syntax, but nothing will happen.

I tried moving it around, before body tag, after body tag, before head tag... still nothing
 
I do php, not asp, but I assume that they are similar enough that you can see what I mean. If the variable $ba is passed in to the page, you can't just do:
include($ba);
This was disabled because of security; someone could ask you to include passwords.php and the w.s wouldn't know the difference. You have to do it like this:

switch($ba){

case &quot;page.php&quot;
include(&quot;page.php&quot;);
break;

case &quot;test.php&quot;
include(&quot;test.php&quot;);
break;
}

Rick
 
Hey, hey, my, my

maybe when trying to include a virtual (ie a file which is in the root folder) the server can't view it.
try using file instead of virtual.

See ya, .: HarshMellow :. &quot;Sperto ne estas tio, kio okazis al vi, sed estas tio, kion vi faras al tio, kio okazas al vi.&quot; (Aldous Huxley)
 
thanks onpnt, I tried the server.execute method and it worked. Thanks a lot for the help
 
my, my, hey, hey

I didn't get what it is all about in the end, but if it worked, then it's fine. : P

.: HarshMellow :. &quot;Sperto ne estas tio, kio okazis al vi, sed estas tio, kion vi faras al tio, kio okazas al vi.&quot; (Aldous Huxley)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top