allFOTC Posted August 14, 2007 Share Posted August 14, 2007 Basically I have a site over at www.allFOTC.com and right now as you can see I'm using all Iframes. It works awesomely for function, but it's gotta be killing my SEO. I'd like to be able to have the same functionality but using php includes so it'll always look like one normal page as far as Search Engines are concerned. Would it be possible to create dynamically changing includes (like when someone wants to watch an ep, JUST the small center block changes to the video) without having to make each page with a full on layout? Right now it's so simple to go find a page I want to edit and only have to look at 5 or 6 lines of code. I'd hate to have to have full layouts on each page and have to fish through all that code to find something. Can anyone steer me in the right direction here? I have very limited experience in PHP, but I'm a quick learner Thanks Quote Link to comment https://forums.phpfreaks.com/topic/64945-trying-to-make-an-iframe-site-into-a-php-include-site-help/ Share on other sites More sharing options...
trq Posted August 14, 2007 Share Posted August 14, 2007 I don't understand where exactly your stuck. The whole include() concept is pretty straignt forward. eg; header.php <html> <head> <title>foo</title> </head> <body> footer.php </body> </html> content.php <?php include 'header.php'; ?> <p>here is some content</p> <?php include 'footer.php'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/64945-trying-to-make-an-iframe-site-into-a-php-include-site-help/#findComment-324070 Share on other sites More sharing options...
lemmin Posted August 14, 2007 Share Posted August 14, 2007 Yeap. Just set up the layout how you want it. In the content areas, put a simple php block like this: echo file_get_contents("thatpage.htm"); You can have "thatpage.htm" be dynamically changed any way you want. A popular way is to make link in this sort of a format: index.php?page=thatpage. Then you can have simple code like: echo file_get_contents($_GET['page'] . ".htm"); This particular code without any checks would allow someone to execute any htm files in that folder even if you don't have a link, so keep that in mind. For example, if you had a file called secret.htm, someone could type in index.php?page=secret and it would load it. file_get_contents() is better to use than include() if it is not a php file being included. Quote Link to comment https://forums.phpfreaks.com/topic/64945-trying-to-make-an-iframe-site-into-a-php-include-site-help/#findComment-324075 Share on other sites More sharing options...
allFOTC Posted August 14, 2007 Author Share Posted August 14, 2007 I don't understand where exactly your stuck. The whole include() concept is pretty straignt forward. eg; header.php <html> <head> <title>foo</title> </head> <body> footer.php </body> </html> content.php <?php include 'header.php'; ?> <p>here is some content</p> <?php include 'footer.php'; ?> I know how to do a simple header/footer include, but I'd like for when people to click "Season 1", it'd load up the season 1 stuff in the episode block. And that season 1 stuff that's being loaded would just be a simple HTML file with content only in it, not the whole layout. I'm not explaining this very well I think. Basically how the site works now, as you know, is the Season 1 link opens up season1eps.html (which is a tiny file of only content, no full site layout) in the side iframe. So it's really simple to make and update things. I'd like the same concept only using php instead of iframes so search engines will pick up on all the content. @lemmin, I will look into your code examples. As I said, I'm a fairly large noob to php so I'll have to do some research on that code Quote Link to comment https://forums.phpfreaks.com/topic/64945-trying-to-make-an-iframe-site-into-a-php-include-site-help/#findComment-324082 Share on other sites More sharing options...
rlindauer Posted August 14, 2007 Share Posted August 14, 2007 file_get_contents() is better to use than include() if it is not a php file being included. Can you expand on this? I have often wondered if using file_get_contents would in fact be better than include, but haven't actually looked into it. Quote Link to comment https://forums.phpfreaks.com/topic/64945-trying-to-make-an-iframe-site-into-a-php-include-site-help/#findComment-324111 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.