p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Server Side Includes


Message #1 by "Wilson Sanchez" <wilsons@s...> on Wed, 13 Feb 2002 14:33:03 -0600
Hello Everyone;



I have tried to include server side files into a PHP file. I am trying to

add a PHP page to my company's current site which uses SSI files.



This is what one of the current pages code looks like:





<LINK href="./style.css" type=text/css rel=stylesheet>

<!--#set var="title" value="Safetech Products - Series 3000 Password

Recovery" -->

<!--#set var="menu" value="products" -->

<!--#set var="submenu" value="s3000" -->

<!--#include virtual="/include/header.shtml" -->



more html......





<!--#include virtual="/include/footer.shtml" -->





This works fine.





###############



This is what I'm trying to do:

* file name: test.php



<LINK href="./style.css" type=text/css rel=stylesheet>

<!--#set var="title" value="Safetech Products - Series 3000 Password

Recovery" -->

<!--#set var="menu" value="products" -->

<!--#set var="submenu" value="s3000" -->

<!--#include virtual="/include/header.shtml" -->



<?PHP



Some stuff/code......



include "/include/footer.shtml" -->





?>





This is not setting the variables up top.



I tried both, inside the <?PHP ?> and outside.





-------



Now, does PHP supports SSI? If not, does someone know a way to get this to

work.





Thanks a lot in advance for your help.



Wilson Sanchez

International Sales

SafeTECH International, Inc.

Tel:  xxx.xxx.xxxx  Fax:  xxx.xxx.xxxx

Toll Free:  xxx.xxx.xxxx



Message #2 by "Hermawan Haryanto" <hermawan@h...> on Thu, 14 Feb 2002 03:46:51 +0700
I realy don't know about SSI, but I know that PHP Support SSI, but the way

you include is correct :

<?php

  include("./somefile.on.the.same.directory.html");

  include("./include/file.in.include.directory.html");

?>



to use variable on the included file then you simply just specify the

variable on the parent, then use it on the child (included file)



Thanks



Hermawan Haryanto

hermawan@h...

----- Original Message -----

From: "Wilson Sanchez" <wilsons@s...>

To: "beginning php" <beginning_php@p...>

Sent: Thursday, February 14, 2002 3:33 AM

Subject: [beginning_php] Server Side Includes





> Hello Everyone;

>

> I have tried to include server side files into a PHP file. I am trying to

> add a PHP page to my company's current site which uses SSI files.

>

> This is what one of the current pages code looks like:

>

>

> <LINK href="./style.css" type=text/css rel=stylesheet>

> <!--#set var="title" value="Safetech Products - Series 3000 Password

> Recovery" -->

> <!--#set var="menu" value="products" -->

> <!--#set var="submenu" value="s3000" -->

> <!--#include virtual="/include/header.shtml" -->

>

> more html......

>

>

> <!--#include virtual="/include/footer.shtml" -->

>

>

> This works fine.

>

>

> ###############

>

> This is what I'm trying to do:

> * file name: test.php

>

> <LINK href="./style.css" type=text/css rel=stylesheet>

> <!--#set var="title" value="Safetech Products - Series 3000 Password

> Recovery" -->

> <!--#set var="menu" value="products" -->

> <!--#set var="submenu" value="s3000" -->

> <!--#include virtual="/include/header.shtml" -->

>

> <?PHP

>

> Some stuff/code......

>

> include "/include/footer.shtml" -->

>

>

> ?>

>

>

> This is not setting the variables up top.

>

> I tried both, inside the <?PHP ?> and outside.

>

>

> -------

>

> Now, does PHP supports SSI? If not, does someone know a way to get this to

> work.

>

>

> Thanks a lot in advance for your help.

>

> Wilson Sanchez

> International Sales

> SafeTECH International, Inc.

> Tel:  xxx.xxx.xxxx  Fax:  xxx.xxx.xxxx

> Toll Free:  xxx.xxx.xxxx

>

>




$subst('Email.Unsub').

>




  Return to Index