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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
ronan1979Commented:
<iframe src ="myInnerPage.html" width="100" height="300">
  <p>Your browser does not support iframes.</p>
</iframe>
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.