-2

I want to do something similar to PHP include but make it work like iframes.

Explained: according to my tiny coding knowledge, iframes' working can be described as individual tabs within the actual browser tabs. Which is good, since I can click anything inside my iframes without having to reload the actual browser tab or affecting its content at all. However this is not true about PHP include method; if I'm using include, whenever I click a link inside the included page, it will navigate my browser tab from index.php to the URL defined in the link.

I'd gladly use an iframe but since its content's height would dynamically change when navigating inside it, I could never get rid of the scrollbar at its side.

Any solutions for the problem out there?

bazsa001
  • 23
  • 4
  • 2
    You have already asked this question once today, and received a number of responses recommending Ajax and other possible solutions. Have you looked into any of these and tried to figure out a solution, and write some code, for yourself? Also, it was made clear to you that PHP includes will not work for you here. They are not flexible. They are server-side, and will never do what you want. – James Scholes Apr 22 '13 at 23:58
  • @JamesScholes I did. But since my question was misunderstandable AND misunderstood, I've got no answer that could've solved the problem. That's why I asked again in a more understandable way. Sorry for the duplication. – bazsa001 Apr 23 '13 at 00:04
  • Questions are editable for that very reason. If you have tried implementing a solution using Ajax/jQuery/etc, and still need help with some specific code, you should create a relevant question, with a better title that has nothing to do with PHP includes. You have asked exactly the same question here as before. – James Scholes Apr 23 '13 at 00:08

1 Answers1

2

You can not do anything like that from PHP. PHP is used only to create static response for the web browser that is asking for some content to be delivered. You need something to make it more dynamic.

You could use AJAX for loading content, or use JavaScript to expand the iframe. jQuery is a really good JavaScript framework for AJAX or finding elements in the DOM.

Lasse
  • 431
  • 5
  • 17