Creating a "dynamic" web page:

I need some help creating a "dynamic" web page.
I know some html but here I would like to do
something that I don't know about.

I'm using a NT Server with IIS.

I have a web page today that is the same for four of our customers. I have created four different NT accounts
(The customers have different accounts but it's the same web page.). It's only one page (default.html).

Now I want one part of the web page (default.html)
to be dependent on the login.

Something like this.

<p align="center"><a href="../" & LoginName & "/" & LoginName & ".xls"><font face="Arial"><strong>Text & LoginName</strong></font></a></p>

This means.

Text shown:
A text - string that is the same for all customers.
Then the login name.

Link:
One level back.
A directory with the same name as the login name.
An Excel - file with the same name as the login name.

It doesn't matter if I'm using html, java, asp or whatever,
as long as it works on IIS.
nr IIIAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

josefsCommented:
Do you can use asp files ?

example:
<p align="center"><a href="../" & <%=LoginName%> & "/" & <%=LoginName%> & ".xls"><font face="Arial"><strong>Text & <%=LoginName%></strong></font></a></p>  
0
nr IIIAuthor Commented:
I can't get it work.
I put the code in an asp - file
located on the IIS - Server.

When I open the web - page in IE i only se "Text & ".
When I take "View Source" this is what I see.

<p align="center"><a href="../" &  & "/" &  & ".xls">
<font face="Arial"><strong>Text & </strong></font></a></p>

It's like IIS doesn't understand
the <%=LoginName%> and the &.

It's quite urgent. Therefore I increase the points.
0
moehlerCommented:
You also need to put

<%@ Language=VBScript %>

At the top of the file and give it an asp extension.

Did you set up your server, or has it been set up for you?
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

nr IIIAuthor Commented:
<%@ Language=VBScript %> doesn't help.
Could I please have a complete simple asp page,
with

<%@ Language=VBScript %>

and

<p align="center"><a href="../" & <%=LoginName%> & "/" & <%=LoginName%> & ".xls"><font face="Arial"><strong>Text & <%=LoginName%></strong></font></a></p>

included.

I havn't set up the server myself.
It's been set up for me.
We're using IIS 4.0.
0
moehlerCommented:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<a href="../<% = Request.ServerVariables("AUTH_USER") %>/<%=Request.ServerVariables("AUTH_USER")%>.xls">Text & <%=Request.ServerVariables("AUTH_USER")%></a>
<P>&nbsp;</P>

</BODY>
</HTML>

Make sure you have Basic or Challenge/Response security turned on for the directory this page is in.
0
moehlerCommented:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<a href="../<% = Request.ServerVariables("AUTH_USER") %>/<%=Request.ServerVariables("AUTH_USER")%>.xls">Text & <%=Request.ServerVariables("AUTH_USER")%></a>
<P>&nbsp;</P>

</BODY>
</HTML>

Make sure you have Basic or Challenge/Response security turned on for the directory this page is in.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nr IIIAuthor Commented:
It works now but there is one problem.

<% = Request.ServerVariables("AUTH_USER") %>

returns not only the "LoginName" but "ServerName\LoginName".

Is there a way around that problem?

0
moehlerCommented:
You could try the following

StrUser = "aegonusa\moehler"
strUserName = right(strUser,len(strUser)-InStrRev(strUser,"\"))

then user strUserName for the logon name.
0
moehlerCommented:
You could try the following

StrUser = "aegonusa\moehler"
strUserName = right(strUser,len(strUser)-InStrRev(strUser,"\"))

then user strUserName for the logon name.
0
moehlerCommented:
You could try the following

StrUser = "aegonusa\moehler"
strUserName = right(strUser,len(strUser)-InStrRev(strUser,"\"))

then user strUserName for the logon name.
0
moehlerCommented:
Oops. looks like I kept my testing values in the last code snippit. It should be...

strUser = request.serverVariables("Auth_User")

...I hate it when I do that.
0
moehlerCommented:
Did that resolve your issue?
0
nr IIIAuthor Commented:
I'm sorry for letting you wait.
I've had som more urgent problems to solve
(a crashed mail - database). Now I'm back
working on this little web - project.

I did some testing before I got your comments.

I tried to disable (unmarked)
"Basic or Challenge/Response security"
in the IIS for this directory.

It was unmarked from the start.
Then I marked it as you told me.
I didn't understand what it did so I wanted
to know what would happen if I unmarked it.

That did very unexpectedly (for me) solve my problem.
(I expected that the page wouldn't work at all.)

Could you please explain this?
0
moehlerCommented:
If you mean why it didn't work when you unchecked basic and challenge/response it is because the browser then hits the web server as an anonymous user and therefore doesn't pass any user information at all. This is because it doesn't need to and/or have the information to pass.

Glad to hear the page is working.
0
nr IIIAuthor Commented:
Thanks for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.