LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP include upsets rendering of HTML page. (https://www.linuxquestions.org/questions/programming-9/php-include-upsets-rendering-of-html-page-599232/)

rblampain 11-13-2007 01:10 AM

PHP include upsets rendering of HTML page.
 
I have HTML pages that "include" other HTML pages. The pages have the extension PHP to allow the "include" statement but are valid HTML documents. The only PHP code is this include statement.

The problem I have is that the page containing the include statement renders properly when the "include" statement is commented out but adds a horizontal scroll bar when the "include" is processed even though the content of the included file is narrower than the available window it fits in. This horizontal scroll bar is not welcome at all although there is a necessary vertical scroll bar.

Note: the "calling" HTML document uses an external CSS file but the called documents have inline CSS (a CSS style for each line of code).

Could anyone tell me what I should look for? What the solution could be?

Thank you for your help.

nc3b 11-13-2007 06:38 AM

How about posting a little bit of code? (Code from the included file would be interesting). It certainly does not have anything to do with php. Most likely the file you include does something nasty. Cheers.

rblampain 11-13-2007 10:59 AM

Thank you for your answer. The site uses frames.

This is a short "included file", the others show more cells but this one gives the same result.This file is intact.

<table style="width: 100%; border-style: solid; border-width: 20px; color: #333366; background: #CCCCFF;">
<tr>
<td style="border-style: solid; border-width: 10px; color: #CC66CC; background: #66FF00; text-align: center;"><br>"The reasonable man adapts himself to the world; the unreasonable man persists in trying to adapt the world to himself.<br>Therefore, all progress depends on the unreasonable man.<br>George Bernard Shaw<br><br></td>
<td style="width: 16px; border-style: none; color: #CCCCFF; text-align: center;"></td>
<td style="border-style: none; color: #CCCCFF; text-align: center;"></td>
<td style="width: 16px; border-style: none; color: #CCCCFF; text-align: center;"></td>
<td style="border-style: none; color: #CCCCFF; text-align: center;"></td>
</tr></table>

Here is the calling HTML code after removal of the text only.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel=stylesheet type="text/css" href="../../css.php">
</head>
<body class="pluie">
<table class="ven" width="100%"><tr><td align="center">
<h1></h1></td></tr><tr><td align="left">
<a name="x"></a>
&nbsp;&nbsp;1 <a href="#1"></a><br>
&nbsp;&nbsp;2 <a href="#2"></a><br>
&nbsp;&nbsp;3 <a href="#3"></a><br>
&nbsp;&nbsp;4 <a href="#4"></a><br>
&nbsp;&nbsp;5 <a href="#5"></a><br>
&nbsp;&nbsp;6 <a href="#6"></a><br>
&nbsp;&nbsp;7 <a href="#7"></a><br>
&nbsp;&nbsp;8 <a href="#8"></a><br>
&nbsp;&nbsp;9 <a href="#9"></a><br>
10 <a href="#10"></a><br>
11 <a href="#11"></a><br>
12 <a href="#12"></a><br>
13 <a href="#13"></a><br>
14 <a href="#14"></a><br>
15 <a href="#15"></a><br>
16 <a href="#16"></a><br>
17 <a href="#17"></a><br>
18 <a href="#18"></a><br>
<br><span class="lastmodified"><script type="text/javascript" language="javascript">
<!--
document.write("Last Updated: "+document.lastModified);
//-->
</script></span></td></tr></table>
<table class="tabl01"><tr><td align="left">
<a name="1"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="2"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="3"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="4"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="5"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="6"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="7"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="8"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="9"></a>
<h3></h3>
</td></tr></table>
<br><br><?php include '../charts/p1.chart05.php'; ?><br>
<table class="tabl01"><tr><td align="left">
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="10"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="11"></a>
<h3></h3>
</td></tr></table>
<br><br><?php include '../charts/p1.chart02.php'; ?><br>
<table class="tabl01"><tr><td align="left">
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="12"></a>
<h3></h3>
</td></tr></table>
<br><br><?php include '../charts/p1.chart04.php'; ?><br>
<table class="tabl01"><tr><td align="left">
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="13"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="14"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="15"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="16"></a>
<h3></h3>
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="17"></a>
<h3></h3>
</td></tr></table>
<br><br><?php include '../charts/p1.chart03.php'; ?><br>
<table class="tabl01"><tr><td align="left">
<hr class="hr4">
<br><a href="poli01.php#x" target="panr"><img src="../../imag/indx.gif" alt="Index" align="right"></a>
<a name="18"></a>
<h3></h3>
</td></tr></table></body></html>

nc3b 11-14-2007 02:21 AM

Sorry I answer so late. I took a good look at your files and I tested them in firefox on my old dying server.
Unfortunately wherever I choose to include the one file you posted (there are four places where you <? include ?> something) I did not get the wanted behavior (horizontal scrollbars).
So I have to assume the problem might be with the css file (css.php) or that the big file you posted is only the code for a frame (you did say the site uses frames).
For a further easy test I suggest you disable the css code in your borwser (it's really easy if you have firefox and this extension which I really like). Good luck, and let us know about your results.

rblampain 11-14-2007 06:49 AM

Thank you for your answer. I've also come to the conclusion it could be a CSS problem and I posted a different question but I am also thinking it may not be possible to solve the problem on the net.

rblampain 11-14-2007 08:12 AM

I have found the HTML code creates rows of cells whose content is occasionally exceeding the width available when single long words are present in cells to be added to find the width of the row. The solution is to make each row of the table a table in its own right so that the browser can accommodate each row separately.

There is no error in the code.

fhleung 01-19-2013 04:50 AM

I would like to know if HTML got similar function / tag can do things like
include() include_once() require() function in php ?

I got website where every pages needs to include menu/header/footer etc

Can HTML alone able to achieve? Because the pages written in HTML only but not php
I also got other technology in the website like css as well as javascript

Please really give me a helping hand.


All times are GMT -5. The time now is 03:42 PM.