httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adam.v...@vestfarms.com.INVALID
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!
<!--#else-->
    <!--#include virtual="/my/script.cgi"-->
<!--#endif-->

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!
<!--#else-->
    <!--#include virtual="/my/script.cgi"-->
<!--#endif-->

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!


Links:
------
[1] https://httpd.apache.org/docs/current/howto/ssi.html

Mime
View raw message