Jump to content

[SOLVED] Using a server side include and php together


candleman98

Recommended Posts

Instead of changing footer files at the bottom of my web pages every year, I created a server side include file that would be placed at the bottom of my web pages, which requires pages to be saved as .shtml files.  I also have code that will pull the year fom the sever, so I no longer hard code "copyright 2008" part of the code.

 

My problem is how can I include both php code to pull the sever year, and a ssi file on the same page, when a page with php requires me to save the page as php and .ssi requires me to save the page as .shtml?

 

 

I have code that works for both the .ssi file and the php code to get the server to display the year, but I can't get them to do it on the same page.

 

Any suggetions?

 

Thanks!

 

{{{Candleman}}}

 

 

haku,

 

Thanks for sending me down this road.... I changed my former .ssi file into a footer_php.php file.

 

Then I removed the .ssi include that was in the index page, and replaced it with

 

<?php

  require ("footer_php.php");

?></p>

 

Lastly I saved the index page as index.php and now I am getting both things I wanted.... a include footer file at the bottom of all my pages that I can modify dozens of pages in one site by just modifying the footer_php.php file, and secondly the year 2008 is not hard coded but is being pulled by the sever through this code:

 

  <?

echo date("Y");

?>

 

 

As displayed here.... 2008 is not hard coded - http://www.webscopedesigns.com/index_php.php

 

Thanks for the direction...

 

{{{Candleman}}}

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.