|Need help with PHP Includes please|
| 9:37 am on Aug 2, 2012 (gmt 0)|
Our website has expanded a lot since we started it and now I've been asked to add on more pages. This means updating the navigation on every. single. page. And obviously, I don't want to have to keep doing this. My only thought is to use PHP includes, however as I have never used PHP before, except for our e-mail forum, I'm not quite sure what to do.
I understand the whole creating a new PHP page just for the navigation and linking it to the other pages, however, will I have to change all of the website pages to .php? At the minute they are .html / .htm.
If I change them all, do I have to remove the .html / .htm ones from my hosting server and replace the pages with the .php ones?
Will having every page as .php affect the website?
Will it make it quicker to load or slower?
How will Google know that the pages have been changed?
Will it affect our Google rankings?
Yes, I'm confused. Your help is much appreciated!
| 9:40 am on Aug 2, 2012 (gmt 0)|
Oops, didn't mean to post this twice, my browser crashed.
| 9:43 am on Aug 2, 2012 (gmt 0)|
changing all pages to php will make the site a tiny bit slower - however if this is noticeable for something trivial like having an include file then change hosts!
you do not need to change your files, you need to configure your webserver to parse .htm/.html as php, this is easily done, you probably have a control panel to do this, if not ask your web hosts and they should do it for you.
| 9:46 am on Aug 2, 2012 (gmt 0)|
Ah, thanks for your answer!
Hmm, the fact that it makes the website slower puts me off. I don't think my boss would be too pleased with that.
Do you know any other ways I could include the navigation in one page so that it's easier to edit?
| 10:44 am on Aug 2, 2012 (gmt 0)|
>>Hmm, the fact that it makes the website slower puts me off. I don't think my boss would be too pleased with that.
i was being pedantic. pages that have to be processed by the php parser will obviously take longer to process than ones that don't - but for a simple include file the time taken should be so tiny that you would not notice.
| 10:56 am on Aug 2, 2012 (gmt 0)|
Someone told me that it will affect our results on Google for a little while, is this true?
| 11:49 am on Aug 2, 2012 (gmt 0)|
>>Someone told me that it will affect our results on Google for a little while, is this true?
if the navigation is the same and the url's are the same then using includes makes no difference to google (infact google cannot tell if you use includes or not) ... to say it would affect google results is utterly absurd.
if however you change the url's, and/or the navigation in some way then of course it could make a difference in SERPS, but this is nothing to do with using includes, it would be because you have made changes.
| 12:22 pm on Aug 2, 2012 (gmt 0)|
You could also just use SSI in your html without adding php where you do not need it.
| 12:28 pm on Aug 2, 2012 (gmt 0)|
Thank you both, will look more into it and hopefully get things sorted soon.