Welcome to WebmasterWorld Guest from 54.226.25.231

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

html pages with .php include files

does it work?

     

someone

12:37 am on Nov 12, 2004 (gmt 0)

10+ Year Member



i am curious about this, can i put a .php include file inside a .html page? would the .html page be able to read the .php file? I am thinking no, it's only the other way around right? thanks

ILLstyle

1:44 am on Nov 12, 2004 (gmt 0)

10+ Year Member



I think it all depends on how your server is set up.
What you have to do is set the server to parse .html files just like .php files.

coopster

11:37 am on Nov 12, 2004 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Exactly. Hiding PHP [php.net] describes how to do so if you are using Apache as your http server.

ILLstyle

3:36 pm on Nov 12, 2004 (gmt 0)

10+ Year Member



coopster

Does this type of set up eat a lot of server resouces?
I mean some of your pages might just be plain HTML with no PHP included, but this sever will still parse it as php. is this a waste, or will it slow things down?

coopster

3:48 pm on Nov 12, 2004 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



There will be a slight performance hit because all HTML will be parsed through the PHP engine. But if you can tell the difference I would be surprised.

I have one entire site setup running backend database hits on every page served up. Each and every page! They all get parsed by PHP, plus database reads! It is so fast you can't tell the difference. The end user thinks it's static html. Oh, there you go, along with the PHP parsing and database connections/queries, I'm running the request through mod_rewrite each time too. And you would never know it unless I told you ;)

ILLstyle

4:55 pm on Nov 12, 2004 (gmt 0)

10+ Year Member



Great coopster
Thanks

someone

5:17 pm on Nov 12, 2004 (gmt 0)

10+ Year Member



cool, thanks everyone for your answers.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month