View previous topic :: View next topic |
Author |
Message |
phaworth -
Joined: 22 Feb 2005 Posts: 3
|
Posted: Tue Feb 22, 2005 7:55 pm Post subject: SSI Directives |
|
|
I'm afraid I think I know the answer to my question since I don't see them listed in the user guide, but are the SSI if and set directives supported? If not, can anyone suggest a way round them not being available? I rely heavily on them in my web pages.
Pete |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Wed Feb 23, 2005 12:00 am Post subject: Re: SSI Directives |
|
|
phaworth wrote: | I'm afraid I think I know the answer to my question since I don't see them listed in the user guide, but are the SSI if and set directives supported? If not, can anyone suggest a way round them not being available? I rely heavily on them in my web pages.
Pete |
if and set are not standard SSI directives. They belong to XSSI (eXtended SSI) and are not supported by current versions of Abyss Web Server.
The only workaround is to convert your XSSI directives to PHP statements (or Perl, depending on your fluency in PHP or Perl). There is a simple and direct mapping between XSSI and PHP commands, so it wouldn't be too difficult to switch.
By the way, XSSI will be supported in a future version. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
phaworth -
Joined: 22 Feb 2005 Posts: 3
|
Posted: Wed Feb 23, 2005 2:41 am Post subject: SSI/PHP Mapping |
|
|
OK, good to hear that XSSI will be supported in a future release.
I'm not overly familiar with either PHP or Perl. Can anyone quickly post the PHP equivalent of these two XSSI statements:
<!--#set var="thispage" value="${DOCUMENT_NAME}" -->
and
<!--#if expr="$thispage = index.shtml" -->
html code
<!--#else -->
html code
<!--#endif -->
I'm using these statements to generate diffenet html code in my include file depending on which .shtml file it has been called from.
Thanks,
Pete |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Thu Feb 24, 2005 1:39 am Post subject: Re: SSI/PHP Mapping |
|
|
Code: |
<!--#set var="thispage" value="${DOCUMENT_NAME}" -->
|
is equivalent to:
Code: |
<?php
$thispage = basename($_SERVER['PHP_SELF']);
?>
|
Code: |
<!--#if expr="$thispage = index.shtml" -->
html code1
<!--#else -->
html code2
<!--#endif -->
|
is equivalent to
Code: |
<?php
if ($thispage=="index.shtml")
{
?>
html code1
<?php
}
else
{
?>
html code2
<?php
}
?>
|
_________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
phaworth -
Joined: 22 Feb 2005 Posts: 3
|
Posted: Thu Feb 24, 2005 5:55 am Post subject: PHP Code |
|
|
Thanks for the info. Here's my current problem.
The set statement is in a file that has an SSI include statement and the if statements are in the included file. If i Give the file with the set statements in a .php extension, the web server doesn't process the SSI include statement. If I give it a .shtml suffic, it processes the include but not the PHP code!
Pete |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Thu Feb 24, 2005 11:25 pm Post subject: Re: PHP Code |
|
|
phaworth wrote: | Thanks for the info. Here's my current problem.
The set statement is in a file that has an SSI include statement and the if statements are in the included file. If i Give the file with the set statements in a .php extension, the web server doesn't process the SSI include statement. If I give it a .shtml suffic, it processes the include but not the PHP code!
Pete |
All you files must be .php files in this situation. The SSI include directives
[code]
<!-- #include virtual="file.ext" -->
should be changed to:
[code]
<?php
include "file.ext";
?> _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
|