richpasco Posted April 17, 2007 Share Posted April 17, 2007 This might be a FAQ, but I couldn't find it... I want to define some server-side includes (SSI) variables for some short HTML code snippets and use them in my SHTML files, like this: [pre] <!--#set var="hours" value="Monday–Friday<BR>8 a.m.–5 p.m." --> ... <!--#echo var="hours" --> [/pre] My problem is that Apache "escapes" my intended HTML code and entities, so that the browser receives [pre] Monday–Friday<BR>8 a.m.–5 p.m. [/pre] and so it displays my HTML snippet instead of executing it. How can I work around this problem? One idea I had was to put each snippet into its own file and then include it, like this: [pre] <!--#include file="hours.shtml" --> [/pre] The problem is, I have dozens of such snippets, and I don't want to clutter my disk with dozens of one-line files. Are there any better ideas? - Rich Link to comment https://forums.phpfreaks.com/topic/47345-ssi-variables-containing-html-code/ Share on other sites More sharing options...
richpasco Posted April 17, 2007 Author Share Posted April 17, 2007 I found the answer:[pre]<!--#echo encoding="none" var="hours" -->[/pre]The part 'encoding="none"' does the trick. - Rich Link to comment https://forums.phpfreaks.com/topic/47345-ssi-variables-containing-html-code/#findComment-230947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.