Helpful Information
 
 
Category: Apache Development
Echoing the right way with XSSI

Hi all,

I'm trying to set a variable which looks like

<!--#set var="title" value="<script>document.write(greeting);</script>" -->

When I echo the "title" variable, though, HTML characters such as < and > appear in ISO format < and > thus ruining my script.

Any idea on how to parse the characters the right way?

Thanks.
TdP

Whichever characters causing troubles, escape it with \.

For the benefit of other users, I found the way to parse the characters as I wanted to in the Apache reference docs at http://www.apache.org.

The trick is to set an "encoding" attribute to "none" just before the "var" in the echo command:

<!--#echo encoding="none" var="title" -->

Similarly, encoding="URL" can be used to %-encode paths when manipulated by SSI.

Cheers,

Teedeepee










privacy (GDPR)