472,351 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,351 software developers and data experts.

session variable in an include file

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

Oct 15 '06 #1
4 2616
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 <%..%>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 15 '06 #2
spectre wrote:
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") &
http://www.aspfaq.com/show.asp?id=2042
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Oct 15 '06 #3
Thanks for your help. I am gone try it , soon.
Bye

Evertjan. wrote:
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 <%..%>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 15 '06 #4
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?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
3
by: Michael J. Astrauskas | last post by:
I have a site where a user logs in and a session variable I created is used to keep track of the fact that the user is logged in. This various...
3
by: Peter Redding | last post by:
Forgive me if this doesn't make too much sense but I've been working on this project all day and my brain is a bit fried. To make some of my code...
1
by: Sean Pinto | last post by:
Ok, you all are going to have to bear with me on this one as it is kinda complicated to explain. I am implementing a company management suite that...
3
by: Geoff Winsor | last post by:
Hi, I am experiencing a problem with recalling a session variable which stores whether a person is logged in to a "members only" section of a...
2
by: Amit D.Shinde | last post by:
Hello Experts.. I need some help regarding cookies and session objects and also global.asa file I am creating one cookie when a user logs in...
1
by: farooqazeem | last post by:
Hi guys, I’m facing some problem can u solve it. Problem is: I’m giving user Id and password in (Login_sess.asp) and submit it to page...
2
by: Eric | last post by:
Hi, I've a problem with trying to retrieve a session variable in an include file. Basically, the main asp creates a session variable: <%...
10
by: sheldonlg | last post by:
Something weird is happening here. I inherited some code that looks like what is shown below. The problem is that when menu1.php is included, the...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.