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
damianb123Asked:
Who is Participating?
 
SwafnilCommented:
Another option would be to add a div layer for your right hand content with a defined height and overflow: scroll so that the content wouldn't drag the page down; should reduce the rewrite time to a minimum.
<table>
<tr>
<td><img src="yourimageantheleft.jpg"></td>
<td>
<div id="content_div" style="width:100%;height:500px;overflow:scroll">
This is were your content is going to be displayed
</div>
</td>
</tr>
</table>

Open in new window

0
 
SwafnilCommented:
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

0
 
damianb123Author Commented:
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
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
ronan1979Commented:
<iframe src ="myInnerPage.html" width="100" height="300">
  <p>Your browser does not support iframes.</p>
</iframe>
0
 
damianb123Author Commented:
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
0
 
ronan1979Commented:
<!-- 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>
0
 
damianb123Author Commented:
Thanks ronan1979, how would the loading page know which a href to use?  Will that load all the pages?
0
 
ronan1979Commented:
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.
0
 
ronan1979Commented:
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.
0
 
damianb123Author Commented:
Perfect, very neat code and easy to follow, your suggestion of using s DIV is wonderful, just what I required.

Thanks v much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.