ZBomber Posted February 19, 2005 Share Posted February 19, 2005 I've been working on trying to get my website better lately. Since I currently use IFrames, Google and other search engines don't really like it. So I'm starting to change it all to php. My big question: If I'm just adding a few php SSI's, do I need to change all the pages from .html to .php? Thanks Link to comment Share on other sites More sharing options...
matt-- Posted February 19, 2005 Share Posted February 19, 2005 What do you mean by php SSIs? Do you mean that you're includ()ing files via php? If so , yes, you do have to rename your files to .php. If you mean that you're using a server side include to include a php document, leave your extensions as .shtml. Link to comment Share on other sites More sharing options...
ZBomber Posted February 19, 2005 Author Share Posted February 19, 2005 Yeh, the first one. This is what I was putting in my site: <?php require("top.htm"); ?> Link to comment Share on other sites More sharing options...
RoxStar Posted February 19, 2005 Share Posted February 19, 2005 SSI (Server Side Includes) Will function if your host supports it (usually if its perl compatible) then you just change your extensions to .shtml .Its really easy for posting news if you have the SSI include news.txt or some other file thats easy to update. Link to comment Share on other sites More sharing options...
Samuel Dravis Posted February 19, 2005 Share Posted February 19, 2005 Originally posted by ZBomber Yeh, the first one. This is what I was putting in my site: <?php require("top.htm"); ?> You could also do it like this: <?php include "top.htm";?> The only real difference is that Require causes a fatal error if something goes wrong; Include just produces a warning. Link to comment Share on other sites More sharing options...
Joetheeskimo Posted February 19, 2005 Share Posted February 19, 2005 Originally posted by Samuel Dravis <?php include "top.htm";?> Don't you need parantheses like you do for require()? It's a function, after all. <?php include("top.htm"); ?> Link to comment Share on other sites More sharing options...
matt-- Posted February 19, 2005 Share Posted February 19, 2005 Originally posted by joetheeskimo5 Don't you need parantheses like you do for require()? It's a function, after all. <?php include("top.htm"); ?> Either will work, if I recall correctly. I always include them for good measure. Also, if you want to surpress warnings and error messages that arise because of the include, you can prefix the command with the @ symbol. <?php @include("top.htm"); ?> Now if the file is missing, the user will be none the wiser. Link to comment Share on other sites More sharing options...
Joetheeskimo Posted February 19, 2005 Share Posted February 19, 2005 Originally posted by matt-- Either will work, if I recall correctly. I always include them for good measure. Also, if you want to surpress warnings and error messages that arise because of the include, you can prefix the command with the @ symbol. <?php @include("top.htm"); ?> Now if the file is missing, the user will be none the wiser. I learned to do the same with database queries....does it work for any function? Link to comment Share on other sites More sharing options...
matt-- Posted February 19, 2005 Share Posted February 19, 2005 Originally posted by joetheeskimo5 I learned to do the same with database queries....does it work for any function? Yes. Link to comment Share on other sites More sharing options...
ZBomber Posted February 19, 2005 Author Share Posted February 19, 2005 What do you mean fatal error? When I had that and the file name was incorrect, nothing happened.... Link to comment Share on other sites More sharing options...
matt-- Posted February 19, 2005 Share Posted February 19, 2005 It should stop parsing php in the event of a fatal error. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.