SSI Directives

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
phaworth
-


Joined: 22 Feb 2005
Posts: 3

PostPosted: Tue Feb 22, 2005 7:55 pm    Post subject: SSI Directives Reply with quote

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 View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Feb 23, 2005 12:00 am    Post subject: Re: SSI Directives Reply with quote

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 View user's profile Send private message Send e-mail
phaworth
-


Joined: 22 Feb 2005
Posts: 3

PostPosted: Wed Feb 23, 2005 2:41 am    Post subject: SSI/PHP Mapping Reply with quote

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 View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Feb 24, 2005 1:39 am    Post subject: Re: SSI/PHP Mapping Reply with quote

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 View user's profile Send private message Send e-mail
phaworth
-


Joined: 22 Feb 2005
Posts: 3

PostPosted: Thu Feb 24, 2005 5:55 am    Post subject: PHP Code Reply with quote

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 View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Feb 24, 2005 11:25 pm    Post subject: Re: PHP Code Reply with quote

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 View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group