We help IT Professionals succeed at work.
Get Started

set constant in html page

tancat asked
Last Modified: 2015-03-04
Hi Experts!

I am trying to modify an existing internal html file, which uses HTML 4.0 Transitional - not sure if more information is needed about my environment.  

Right now several links point to the dev server, but when I move the file to prod, I want to update the server name in a single location instead of within each href value.

For example, a link points to \\dev_server\myfiles\myfile.txt.  How do I set a constant at the top of the file with the server name that can be referred to as part of the href value?  

Then instead of having to replace each instance of \\dev_server\myfiles\myfile.txt with \\prod_server\myfiles\myfile.txt, I could just use \\[server_instance]\myfiles\myfile.txt throughout and update the [server_instance] constant with the appropriate value.

As an alternative, PHP is also installed on the servers, but I don't know which version, I just know that there are some existing files that have php and html intermixed.  I don't know very much php, but how could I php to set the value of a constant, and then use that constant within the HTML?

Or maybe you have a better idea for a simple solution?  (My options are limited at the moment, so I can't use, for example, javascript.)  

My skills are with database development and I'm very, very new to html and php.
Watch Question
Most Valuable Expert 2020
Most Valuable Expert 2018
This problem has been solved!
Unlock 1 Answer and 10 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE