Conjurer Posted August 8, 2006 Share Posted August 8, 2006 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? Quote Link to comment Share on other sites More sharing options...
bltesar Posted August 8, 2006 Share Posted August 8, 2006 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. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 8, 2006 Share Posted August 8, 2006 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. Quote Link to comment Share on other sites More sharing options...
Conjurer Posted August 8, 2006 Author Share Posted August 8, 2006 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? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 8, 2006 Share Posted August 8, 2006 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. Quote Link to comment Share on other sites More sharing options...
Conjurer Posted August 8, 2006 Author Share Posted August 8, 2006 Ok, I get that part, but is there an advantage to using SHTML when it does the job? Quote Link to comment Share on other sites More sharing options...
bpops Posted August 8, 2006 Share Posted August 8, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.