SSI Environment Variables

Status
Not open for further replies.

coversx

New Member
Messages
15
Reaction score
0
Points
0
Hi all,

I am trying to use the built in Apache environment variables, such as date last modified, however even if I delete a file and upload afresh, it still shows the date the "file" was originally uploaded.

Hoping someone can help.

Thank you
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,929
Reaction score
118
Points
63
We use LiteSpeed for our Free Hosting servers, so certain apache features may not be completely available or compatible. You can always write your pages using PHP to get the last modified date and other such information instead of using Server Side Includes.

EDIT: That said, looking through LiteSpeed's docs indicate SSI is fully supported, so I'm not entirely sure what's going on with your issue then. My recommendation about using PHP still stands, however :)
 
Last edited:

coversx

New Member
Messages
15
Reaction score
0
Points
0
Hi Ryan,

Thank you for responding to me.

The environment variables are working insofar as <!--#flastmod virtual=''--> is concerned, however they do not work as <!--#echo var='LAST_MODIFIED' --> but as you say, I can just use PHP to achieve the same end.
 
Last edited:

hbazer

Member
Messages
398
Reaction score
7
Points
18
Do you see a current time-stamp for the file - on the server - after a 'up-load' ?

I did some test on sever [ Vox ]

The 'last update' changes after every upload for me (without a delete)

This is my PHP test code...
PHP:
<?php
$last_modified = filemtime("index.php");
print"Page Last Edited (server time) ";
print date("D M j,Y H:i:s T", $last_modified);
?>

I receive this output...
Page Last Edited (server time) Fri May 3,2013 16:17:42 CDT

############################
This is my SHTML test file...
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <title>
      Hello World using SSI
    </title>
  </head>
<body>

<h1>Hello World using SSI</h1>

<BR><BR><BR>

<!--#config timefmt="%A %B %e %Y %H:%M:%S %Z" -->
Local Date: <!--#echo var="DATE_LOCAL" -->
<BR>
GMT Date: <!--#echo var="DATE_GMT" -->

<BR><BR><BR>

Last updated: <!--#echo var="LAST_MODIFIED" -->

<BR><BR><BR>

Last updated: <!--#flastmod file="$DOCUMENT_NAME" -->

<BR><BR><BR>

Size test: <!--#fsize file="$DOCUMENT_NAME" -->

</body>
</html>

I receive this output...
Hello World using SSI

Local Date: Friday May 3 2013 16:12:08 CDT
GMT Date: Friday May 3 2013 21:12:08 GMT

Last updated: Friday May 3 2013 16:12:02 CDT

Last updated: Friday May 3 2013 16:12:02 CDT

Size test: 619
 

coversx

New Member
Messages
15
Reaction score
0
Points
0
Thank you for the reply.

When using <!--#flastmod file="$DOCUMENT_NAME" --> I get [error: stat() failed! and my custom error message is not used.

I can try deleting the folder as well but the only way it seems to be working for me is via <!--#flastmod virtual=''--> which I am only using on files other than the current (shtml) file.

Kind Regards
 
Status
Not open for further replies.
Top