Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Jul 2007
    Posts
    92
    Member #
    15534
    Hello everybody,
    I plan on using PHP included() quite heavily in the next site I'm doing... but here's my question:
    On a previous site, I made the mistake of using iFrames... I found out this is a disaster for search engines. I found out that it's possible for the search engine to crawl the page within the iFrame... so for example, if you search in google for something that is found within the iFrame, it could take you to the iFrame page, not the main page the iFrame was referenced in (like you'd want it to).
    Do PHP includes act like this. I know that the search engines just see the HTML but would it be possible for someone to get a direct link through the search engine to the file that is being included.
    Another example incase I'm not being clear. I have my products.php which includes the file productinclude.php. If someone searches for keywords or text in google, is it possible for them to get a direct link to the productinclude.php, as opposed to the main page products.php.
    I HOPE NOT! Thanks for the help...

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    No, not at all.

    The search engines, or spiders see the rendered page, that is the HTML after any data retrieved from databases, include files etc.

    And, because the include files are just pure content there are no duplicate <html>, <meta> tags.

    Example: index.php

    HTML Code:
    <html>
    
    <head>
    
      <titleExample</title>
    
    </head>
    
    <body>
    
      <?php include("file.txt"); ?>
    
    </body>
    
    </html>
    And file.txt:
    Code:
    <p>Hello, I am file.txt</p>
    So when index.php is viewed in a browser or by a spider this is what is present
    HTML Code:
    <html>
    
    <head>
    
      <title>Example</title>
    
    </head>
    
    <body>
    
    <p>Hello, I am file.txt</p>
    
    </body>
    
    </html>

  4. #3
    Member
    Join Date
    Jul 2007
    Posts
    92
    Member #
    15534
    Thanks! That's what I thought.

    What file formats can the include be? .txt, .html, .php...

  5. #4
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    As far as I know it can be any file type, but common practice is to name your files .inc, as they are include files after all.

    Other file types used are
    • .html
    • .txt
    • .php

  6. #5
    Member
    Join Date
    Jul 2007
    Posts
    92
    Member #
    15534
    thanks!

  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Never, ever give PHP scripts an extension of .inc. It will expose the source code.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  8. #7
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Yes, I should have said. If the files you are including have PHP inside them then name them file.php and not file.inc

    As a rule, .inc is just for HTML/Content


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:12 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com