raydona Posted December 18, 2009 Share Posted December 18, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/185641-hyperlink-in-template-file/ Share on other sites More sharing options...
premiso Posted December 18, 2009 Share Posted December 18, 2009 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). Quote Link to comment https://forums.phpfreaks.com/topic/185641-hyperlink-in-template-file/#findComment-980293 Share on other sites More sharing options...
teamatomic Posted December 19, 2009 Share Posted December 19, 2009 put it in an external JS file then call the file from the header, use the onload in the <body> HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/185641-hyperlink-in-template-file/#findComment-980570 Share on other sites More sharing options...
teamatomic Posted December 19, 2009 Share Posted December 19, 2009 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>') Quote Link to comment https://forums.phpfreaks.com/topic/185641-hyperlink-in-template-file/#findComment-980581 Share on other sites More sharing options...
haku Posted December 20, 2009 Share Posted December 20, 2009 That cuts off the link for any users who don't have javascript enabled. Use php includes. It's the most consistent method. Quote Link to comment https://forums.phpfreaks.com/topic/185641-hyperlink-in-template-file/#findComment-980761 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.