Link to home
Start Free TrialLog in
Avatar of damianb123
damianb123Flag for United Kingdom of Great Britain and Northern Ireland

asked on

require Iframe but using PHP headers

Hi,
   I have a PHP website configured which uses the header.inc.php and footer.inc.php as the template.  I have a box in the middle of the page which I require as an Iframe, however the Iframe page src would need to be hard coded into the header.inc, which cannot happen due to the various pages.

What I want to achieve is this box in the middle, rather than extending the page and making everything out of sync, I want a scrollbar, so the page size is always the same.

Can anyone give me any advice?

Thanks

Damian
Avatar of Swafnil
Swafnil
Flag of Germany image

Could you give a more detailed description of what you want? The above brief description doesn't give a good picture of what your aim is i.e. what do you mean with "I want a scrollbar, so the page size is always the same."?
This is what I'm guessing how the page should look like (hope the "ascii art" doesn't get distorted too much).


+---------------------------+
+ header                    +
+                           +
+ [ iframe ]                +
+---------------------------+
+ content                   +
+                           +
+---------------------------+
+ footer                    +
+---------------------------+

Open in new window

Avatar of damianb123

ASKER

I have a table with two columns..... the right hand column has an image within it, which is fine.  The left hand column has another embedded table, which currently has text within it, however if that text is more than then length of the column it drags the page down.  I want this to be static and use a scrollbar.....

I hope that makes it clearer.

Thanks
Avatar of ronan1979
ronan1979

<iframe src ="myInnerPage.html" width="100" height="300">
  <p>Your browser does not support iframes.</p>
</iframe>
The trouble with that ronan1979 is that the PHP is using the header.inc.php for its template, as each page has different content, but uses the same header file - your suggestion will make all pages the same won't it?

Damian
<!-- header -->
<a href="1.html" target="content">page 1</a>
<a href="2.html" target="content">page 2</a>

<!-- content -->
<iframe id="content" name="content" src="default.html" width="100" height="300">
  <p>Your browser does not support iframes.</p>
</iframe>
Thanks ronan1979, how would the loading page know which a href to use?  Will that load all the pages?
the links in header will load in the iframe called 'content' because
- they have the target attribute set to 'content'
- the iframe is named 'content'

so if you click on [page 1] it will load '1.html' in the iframe.
so if you click on [page 2] it will load '2.html' in the iframe.

your global page does not change, only the iframe changes.
ASKER CERTIFIED SOLUTION
Avatar of Swafnil
Swafnil
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the idea of @Swafnil is a good option.
if the server is set to compress/zip  the text pages i supposed its not going to be a problem.
Perfect, very neat code and easy to follow, your suggestion of using s DIV is wonderful, just what I required.

Thanks v much