Forum Moderators: phranque

Message Too Old, No Replies

Server Side Includes & '#set var'

         

lanesharon

6:33 pm on Jul 9, 2006 (gmt 0)

10+ Year Member



I have some preset headers and footers on my website and recently changed servers. Now it seems that one statement is not working. The includes are working, but the '#set var' is not. Example - set:
<!--SSI include top menus-->
<!--#set var="title" value="Cancer Advocate" -->
<!--#set var="desc" value="Cancer advocacy information." -->
<!--#include file="private/top.php" -->

Example - call:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="content-language" content="global">
<META NAME="description" CONTENT="<?=$desc?>">
<?php
echo "<title>$title</title>"
?>

And my .htacces that pertains to this:

Options Indexes FollowSymLinks Includes
AddType text/html .html
AddHandler server-parsed .html

This all worked just fine on the original server, but seems to have stopped working on the new one. Do you know if there is something that I need to be setting up in .htaccess that is not currently set?

Thanks, Sharon

jdMorgan

5:23 pm on Jul 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You are mixing SSI and PHP here. The difference in your servers may be that on your original one, SSI was processed first, while on the new one, PHP is processed first, therefore PHP sees the vars as undefined.

You might want to try a search on WebmasterWorld for "SSI and PHP", or investigate the order in which SSI and PHP are executing on your new server.

Jim