session variable in an include file

S

spectre

Hello,

I first create a session variable 'client' in the login.asp file
The login.asp file opens a file (xxx.asp) with an include file
..
If I write
<!--#include file="../../../data/" & session("client") &
"/language_ger.inc"-->
I have a message stating that the application can't find the file.

If I write the path without the variable (" & session("client") & ")
<!--#include file="../../../data/eurovini/language_ger.inc"-->
it works without any problem.

Question
- is there is an error in the syntax?
- is it possible to include this kind of variable in an include file.
And if not, any idea to get the same result?

Thanks for your help. Bye
 
E

Evertjan.

spectre wrote on 15 okt 2006 in microsoft.public.inetserver.asp.general:
<!--#include file="../../../data/" & session("client") &
"/language_ger.inc"-->

You cannot use asp code in an include declaration.

The include first inserts the text content in the file,
and THEN the total is read by the asp interpretor,
rendering the html for the stream to clientside.

Try:

<% ' vbscript assumed
server.execute "../../../data/" & session("client") & "/lang.asp"
%>

This cannot be the same file,
as server.execute will execute asp code without the <%..%>
 
E

Evertjan.

spectre wrote on 15 okt 2006 in microsoft.public.inetserver.asp.general:
Thanks for your help. I am gone try it , soon.

[Please do not toppost on usenet]

gone soon?
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top