nr III
asked on
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.
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><
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.
ASKER
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.
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.
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?
<%@ 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?
ASKER
<%@ 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></f ont></a></ p>
included.
I havn't set up the server myself.
It's been set up for me.
We're using IIS 4.0.
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></f
included.
I havn't set up the server myself.
It's been set up for me.
We're using IIS 4.0.
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<a href="../<% = Request.ServerVariables("A UTH_USER") %>/<%=Request.ServerVariab les("AUTH_ USER")%>.x ls">Text & <%=Request.ServerVariables ("AUTH_USE R")%></a>
<P> </P>
</BODY>
</HTML>
Make sure you have Basic or Challenge/Response security turned on for the directory this page is in.
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<a href="../<% = Request.ServerVariables("A
<P> </P>
</BODY>
</HTML>
Make sure you have Basic or Challenge/Response security turned on for the directory this page is in.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It works now but there is one problem.
<% = Request.ServerVariables("A UTH_USER") %>
returns not only the "LoginName" but "ServerName\LoginName".
Is there a way around that problem?
<% = Request.ServerVariables("A
returns not only the "LoginName" but "ServerName\LoginName".
Is there a way around that problem?
You could try the following
StrUser = "aegonusa\moehler"
strUserName = right(strUser,len(strUser) -InStrRev( strUser,"\ "))
then user strUserName for the logon name.
StrUser = "aegonusa\moehler"
strUserName = right(strUser,len(strUser)
then user strUserName for the logon name.
You could try the following
StrUser = "aegonusa\moehler"
strUserName = right(strUser,len(strUser) -InStrRev( strUser,"\ "))
then user strUserName for the logon name.
StrUser = "aegonusa\moehler"
strUserName = right(strUser,len(strUser)
then user strUserName for the logon name.
You could try the following
StrUser = "aegonusa\moehler"
strUserName = right(strUser,len(strUser) -InStrRev( strUser,"\ "))
then user strUserName for the logon name.
StrUser = "aegonusa\moehler"
strUserName = right(strUser,len(strUser)
then user strUserName for the logon name.
Oops. looks like I kept my testing values in the last code snippit. It should be...
strUser = request.serverVariables("A uth_User")
...I hate it when I do that.
strUser = request.serverVariables("A
...I hate it when I do that.
Did that resolve your issue?
ASKER
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?
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?
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.
Glad to hear the page is working.
ASKER
Thanks for your help.
example:
<p align="center"><a href="../" & <%=LoginName%> & "/" & <%=LoginName%> & ".xls"><font face="Arial"><strong>Text & <%=LoginName%></strong></f