473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Varying the HTML References

Hey there,

Problem: In HTML or in server-side generated HTML, is there a way to change the inclusion of the HTML references, dynamically, e.g.
In one setting, all references are based upon one place of the included files

//my_base_web_URL/skins/images/someimage.gif
//my_base_web_URL/skins/images/somestyle.css

at some other situation, this should be changed accordingly, e.g

//my_base_web_URL/other-folder-path/skins/images/someimage.gif
//my_base_web_URL/other-folder-path/skins/images/somestyle.css

Perhaps a variable
location = //my_base_web_URL/other-folder-path/skins/images

and then
location = //my_base_web_URL/skins/images/someimage.gif

Is this one doable in PHP or DHTML (I'm newbie to these technologies)

Thank you.
Aug 15 '09 #1
3 1395
Dormilich
8,658 Expert Mod 8TB
you can do that easily with PHP or any server side language (as long as you find a way to tell PHP when to do what). if you want to change all relative links you can also try the <base> element.
Aug 15 '09 #2
Thanks Dormilich for the tips. I got how the X/HTML <base> tag attribute works.

In PHP, perhaps things are different and need more background. Could you please provide a simple example as a tip and I will digg down with what you provide?

For instance,
Set base_url

what the exact PHP code of referencing a relative URL -- if you can provide a simple tip, it would be helpful and I will read about it in a PHP reference manual.

Thank you.
Aug 15 '09 #3
Dormilich
8,658 Expert Mod 8TB
@hsheboul
unfortunately that is not as easy, because there are many different ways (variables, functions, objects, templates, …) of making such an url. what is common to all is that you need to provide the script with an input/setting upon which it can decide what value to use for the url. once you know that, you can give your coding creativity a go.
Aug 15 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: yawnmoth | last post by:
say i have a for loop that would iterate through every character and put a space between every 80th one, in effect forcing word wrap to occur. this can be implemented easily using a regular...
11
by: Albretch | last post by:
Hi HTML gurus, I understand that you would use HTML character entities for &auml; and &euro; but why on earth would anyone encode: a colon: ":", a semicolon ";", or a gramatical period...
1
by: fripper | last post by:
I have had some experience with VB .Net but I am having difficulty coming to grips with how to set up a subroutine to accept varying classes for its arguments. An example will help to explain. I...
0
by: Mike Leahy | last post by:
Okay.I'm following the documentation that came with the PostgreSQL source code (located in /usr/doc/postgresql-7.3.4-2/html/arrays.hmtl in my cygwin root). I created have a table with a varchar...
7
by: Mike Mascari | last post by:
Hello. I have time-varying relation variables similar to the ones described in this Rick Snodgrass article: http://www.informix.com.ua/articles/tempref/tempref.htm An example: CREATE...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
12
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
5
by: Stepheno | last post by:
Hi, I am a recently converted Iseries (AS/400) RPG programmer trying to learn HTML/CSS/JavsScript all at the same time (not fun). My problem deals mostly with CSS. I will be reveiving a table,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.