Welcome to WebmasterWorld Guest from 54.157.239.93

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Question about php includes in an html file

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

New User

joined:Aug 7, 2012
posts: 14
votes: 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
10:01 am on Aug 20, 2012 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10749
votes: 43


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.
1:39 pm on Aug 20, 2012 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:3107
votes: 120


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.
5:22 pm on Aug 20, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13537
votes: 403


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).
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members