Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 07-06-2005, 07:05 PM php or ssi include
Novice Talker

Posts: 5
Trades: 0
I have a website with many pages I believe I need to have a php or ssi include file so that I would not have to update evrey single page etc.

I did a search here and on the web and I am still a little confused. I read this thread: http://www.webmaster-talk.com/showth...ht=ssi+include and it was somewhat helpful, but vague at the same time.

Is anyone aware of a detailed tutorial on how to accomplish this? Also, all of the files (with the exception of the guestbook and contact page) ends in .htm and I read I need to change them to .shtml. Is there any way around this?

Thanks for reading.

Sunni
sunnigrl is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-09-2005, 06:35 AM
HitRaj47's Avatar
Extreme Talker

Posts: 177
Location: GA
Trades: 0
if your server/host has PHP installed, then you can use php's include() function. it's quite simple to use.

however, to use php in your pages, you need to change the extension to .php

same applies for ssi, to use ssi i think you need to change the page extension to .shtml (i think, ive not actually used it before!)

what you should do is create a header page (all code that will go before the content) and a footer page (all code that goes after the content). then when you make a page, say "about.php" (your "About Us" page, just an example), you wcould include the header and footer with the code like so:

<?php include ("header.php") // Page code before content ?>

[ You page code/content for about us will go here ]

<?php include ("footer.php") // Page code after content ?>

save that page as about.php and that's basically it. also, note that the header and footer files don't have to have the .php extension, unless you want to write php in them.
HitRaj47 is offline
Reply With Quote
View Public Profile
 
Old 07-09-2005, 01:30 PM
Jacky's Avatar
Novice Talker

Posts: 14
Trades: 0
Actually, it is not necessary to change file name extensions to .shtml to use ssi (server side include). You can use the "XBitHack on" directive in a .htaccess file and "chmod +x" your .html files to use ssi. For detailed explanation, please check the section "Configuring your server to permit SSI" in this page http://httpd.apache.org/docs/howto/ssi.html

To use PHP, it is not necessary to change the filename extension to .php. Simply add "AddType application/x-httpd-PHP .ASP .PHP .HTML" to a .htaccess file. This will allow your php scripts to run in .asp, .php and .html files. Cool huh?

Happy coding.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Jacky is offline
Reply With Quote
View Public Profile Visit Jacky's homepage!
 
Reply     « Reply to php or ssi include
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16840 seconds with 12 queries