473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 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 2694
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 pages query a MySQL database to get information...
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 more readable I made a file (called urls.inc)...
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 requires Role-Based authentiations (ie. users are...
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 website. This area of the site has been working...
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 on my website. The cookie stores the login name of...
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 (sess_test.asp). I am setting session variable...
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: <% Session("var1") = "Hello" %> And then when I click...
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 session variables are not known in homepage.php. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.