[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Creating a "dynamic" web page:

Posted on 1999-07-31
15
Medium Priority
?
155 Views
Last Modified: 2013-12-25
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.
0
Comment
Question by:nr III
  • 9
  • 5
15 Comments
 

Expert Comment

by:josefs
ID: 1864599
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
 

Author Comment

by:nr III
ID: 1864600
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
 
LVL 2

Expert Comment

by:moehler
ID: 1864601
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Author Comment

by:nr III
ID: 1864602
<%@ 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
 
LVL 2

Expert Comment

by:moehler
ID: 1864603
<%@ 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
 
LVL 2

Accepted Solution

by:
moehler earned 1600 total points
ID: 1864604
<%@ 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
 

Author Comment

by:nr III
ID: 1864605
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
 
LVL 2

Expert Comment

by:moehler
ID: 1864606
You could try the following

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

then user strUserName for the logon name.
0
 
LVL 2

Expert Comment

by:moehler
ID: 1864607
You could try the following

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

then user strUserName for the logon name.
0
 
LVL 2

Expert Comment

by:moehler
ID: 1864608
You could try the following

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

then user strUserName for the logon name.
0
 
LVL 2

Expert Comment

by:moehler
ID: 1864609
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
 
LVL 2

Expert Comment

by:moehler
ID: 1864610
Did that resolve your issue?
0
 

Author Comment

by:nr III
ID: 1864611
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
 
LVL 2

Expert Comment

by:moehler
ID: 1864612
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
 

Author Comment

by:nr III
ID: 1864613
Thanks for your help.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Before you approach an Ionic Mobile App development company for developing mobile apps using the ionic framework, you must know why you should choose the framework. Let's try to understand that through this article.
These seven tips can help you create an extraordinary website, one that captivates audiences and has them wanting to return regularly for more. Keep reading to find out what your site is missing and what you need to add!
The viewer will learn how to dynamically set the form action using jQuery.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question