httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [users@httpd] SSI conditionals not accepting "||" or "&&"
Date Sat, 04 Nov 2017 16:23:13 GMT
Good afternoon all,

I've been tinkering with setting up SSI's in some HTML of mine, and  
one thing I'm trying to do is have the server decide if it should post  
a signup link, or display a logged-in users name (using perl cgi  
includes). Using this kind of works:

<!--#if expr="%{HTTP_COOKIE} !~ /my_cookie/"-->
    Sign up here!
    <!--#include virtual="/my/script.cgi"-->

The problem with this is that, after the user signs in, they still see  
the sign up text until they refresh their browser (assuming the  
session cookie isn't seen immediately after sign-in). So, I tweaked a  
little to try and compensate (by showing the sign up text if they're  
not already on the clients page, which requires login):

<!--#if expr="%{HTTP_COOKIE} !~ /my_cookie/" && expr="%{REQUEST_URI}  
!~ /clients/-->
    Sign up here!
    <!--#include virtual="/my/script.cgi"-->

However, this always results in the sign up text showing. The Apache  
docs[1] indicate that all expressions are supported here, but, unless  
my syntax is wrong, that doesn't look to be the case.

Am I missing something? Is my syntax wrong? Appreciate any help!


View raw message