Forum Moderators: phranque
<!--#include virtual="/search.php?query=<!--#echo var="VAR_smtg" -->" -->
<!--#echo var="VAR_smtg" --> is the keyword I want to pass as the query above but the full string can't be passed correctly. The variable is being broken because of the same start<-- and end--> tags. The final query passed to search.php is only the <!-- part. :O
Thought of setting a new variable by using the old one with php but all of the pages are .html, and the server couldn't run php on .html with the .htaccess trick. Can you think of any other way?
Made it work using a cgi script and calling the search.php results by it but that's a bad solution regarding SEO.
<script src="/cgi-bin/script.cgi?/search.php?query=<!--#echo var="VAR_smtg" -->"></script>
Any ideas? How could you solve this? Thank you very much.
PS. Can't even pull my hair; got a complete hair cut! lol
Variable Substitution(emphasis added)Variable substitution is done within quoted strings in most cases where they may reasonably occur as an argument to an SSI directive. This includes the config, exec, flastmod, fsize, include, and set directives, as well as the arguments to conditional operators. You can insert a literal dollar sign into the string using backslash quoting:
I'd try this:
<!--#include virtual="/search.php?query=$VAR_smtg" -->
Jim