homepage Welcome to WebmasterWorld Guest from 54.166.113.249
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Need help with PHP Includes please
That_Girl



 
Msg#: 4481199 posted 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!

 

That_Girl



 
Msg#: 4481199 posted 9:40 am on Aug 2, 2012 (gmt 0)

Oops, didn't mean to post this twice, my browser crashed.

topr8

WebmasterWorld Senior Member topr8 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4481199 posted 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.

That_Girl



 
Msg#: 4481199 posted 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?

topr8

WebmasterWorld Senior Member topr8 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4481199 posted 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.

That_Girl



 
Msg#: 4481199 posted 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?

topr8

WebmasterWorld Senior Member topr8 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4481199 posted 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.

swa66

WebmasterWorld Senior Member swa66 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4481199 posted 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.

[httpd.apache.org...]

That_Girl



 
Msg#: 4481199 posted 12:28 pm on Aug 2, 2012 (gmt 0)

Thank you both, will look more into it and hopefully get things sorted soon.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved