homepage Welcome to WebmasterWorld Guest from 54.204.58.87
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Question about php includes in an html file
Johndh




msg:4486432
 9:40 am on Aug 20, 2012 (gmt 0)

I don't actually have a problem, but i'm not sure why not?

I used php includes to add a footer and top menu on all my pages, so that I can change them easily. I was expecting that i would then have to change all the .html files to .php, but i didnt. It works fine and its very handy to still be able to check new content locally on the html file before uploading(although without the includes).

Did i just get lucky or does this always work like that?

cheers

john

 

phranque




msg:4486440
 10:01 am on Aug 20, 2012 (gmt 0)

welcome to WebmasterWorld, Johndh!

assuming it's an apache server this can be specified using either the AddType or AddHandler directive, depending on your specific configuration.

not2easy




msg:4486484
 1:39 pm on Aug 20, 2012 (gmt 0)

It sounds like your host had already set up the server to handle it that way, not all hosts do so it is a matter of chance to try it and find it working without needing tweaks. I have seen hosts set up where it cannot work, but not recently.

lucy24




msg:4486541
 5:22 pm on Aug 20, 2012 (gmt 0)

its very handy to still be able to check new content locally on the html file before uploading(although without the includes)

Go get a pseudo-server like MAMP or WAMP. The basic version is free. It will make your local files behave just like the "live" ones, including oops any includes. And other good stuff like /site-absolute links (leading slash) and directory/ names (trailing slash).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved