Jump to content

Recommended Posts

Hi,

  I wish to create about 200 web pages (html) files. Each file will have a hyperlink (<a href="http://......) to another site. Normally you would place the hyperlink in the html file. But if I had to change the address to a different site I do not fancy going through each and every file changing the hyperlink. Is there any way I can place the hyperlink in a CSS file so that if the

address changes I would have to just alter it once in the template CSS file and it would alter the address in all the html files. All help will be greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/185641-hyperlink-in-template-file/
Share on other sites

Do you have PHP on the server?

 

If so you can link all the CSS to a PHP script and use header's / ( file_get_contents or cURL) to grab the css from the remote site and output that CSS.

 

If you do not have PHP on the server, I hardly doubt that without some form of a server side scripting language this would be possible (unless you use server side includes SSI).

hmmm.... no edit button??

 

on second thought

 

put this on your page where you want the link

<script src="link.js" type="text/javascript"> </script>

 

 

us the doc.write in the external file

    document.write('<a href="link.html">MyLink</a>')

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.