Jump to content

Archived

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

Conjurer

Shtml vs PHP Includes

Recommended Posts

Is there a difference? 

If you have access to php on your hosting site when and why would it make since to use an shtml include instead of a PHP include?

Share this post


Link to post
Share on other sites
how do shtml includes work? 

Obviously, a only a PHP include can have PHP code and dynamically generated content, but if only static HTML is needed, perhaps the shtml include is faster and uses less server resources.

Share this post


Link to post
Share on other sites
php is dynamic - you can use certain information either submitted by a client or drawing database records etc. etc.

shtml and server side includes are simply that. They cant be dynamic like php. the only thing you could do is include certain pages on certain pages but they will always look the same.

Share this post


Link to post
Share on other sites
So if you can do it with PHP is there a reason trying to learn to do it with SHTML

Are there any situations where an SHTML include would be preferred to PHP - given your server can process both?

Share this post


Link to post
Share on other sites
you could use shtml to include something that NEVER changes (unless you alter the file you are including).

use php if you want this particluar element to beable to show different content - content that may change daily or content created randomly from the information you have provided in that file.

Share this post


Link to post
Share on other sites
Ok, I get that part, but is there an advantage to using SHTML when it does the job?

Share this post


Link to post
Share on other sites
Like bltesar said, it might use fewer system resources. I've defenitely used some servers in the past that are a tad slow with php, and if I was writing something static, i always preferred shtml over includes.

The habit has stayed with me now, and I have a main site logo with a menu that is included() on php pages where I have dynamic stuff going on, but is incorporated with shtml on pages that don't change, like FAQs, LINKS, etc.

Share this post


Link to post
Share on other sites

×

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.