Varying the HTML References

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsheboul
    New Member
    • May 2009
    • 14

    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.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    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.

    Comment

    • hsheboul
      New Member
      • May 2009
      • 14

      #3
      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.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        Originally posted by hsheboul
        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?
        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.

        Comment

        Working...