Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating a "dynamic" web page:

Posted on 1999-07-31
15
Medium Priority
?
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

722 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