Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Assigning a variable for the web application's path

Posted on 2002-06-13
5
Medium Priority
?
145 Views
Last Modified: 2010-04-09
How can I declare a path statement whereas  in my HTML I can just call the variable name instead of the path?  I have seen code like <a href = <%userpath%> & "whatever.htm"...... but don't know how to use it. I want to use it in multiple pages mainly so I do not have to keep changing my hardcoded paths in all my pages whenever I move something.
I am using Javascript in my pages too.
0
Comment
Question by:CCOIA
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:KenAdney
ID: 7075998
Well, I think you've got most of it, the part about  referring to the previously defined variable.  I think all you have to do is define what "userpath" is, for instance:

<%userpath = "../file_directory/" %>

put somewhere in the head of the ASP page.
0
 

Author Comment

by:CCOIA
ID: 7076175
That is my problem (should have elaborated more).  It is not an ASP page.  It is on a page that will be on an AS400 server running Webshere.  Can I still use the above syntax in a non-ASP page?
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 200 total points
ID: 7076222
That is strictly ASP syntax.  You can do it ins straight HTML by putting this in the head of the pages.

<base href="http://www.mysite.com/myfolder/index.html">
It will then treat everything up to the file name as the base path.  so a reference in the page like:

<a href="thepage.htm">  We be interrpreted as <a href="http://www.mysite.com/myfolder/thepage.htm">

and  <img src="images/my.gif"  will be >img src="http://www.mysite.com/myfolder/images/my.gif">

Cd&
0
 

Author Comment

by:CCOIA
ID: 7076250
Thanks, just what I was looking for.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7076468
Glad we could help.  Thanks for the A. :^)

Cd&
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

916 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