LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-13-2007, 01:10 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
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.
 
Old 11-13-2007, 06:38 AM   #2
nc3b
Member
 
Registered: Aug 2005
Posts: 330

Rep: Reputation: 32
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.
 
Old 11-13-2007, 10:59 AM   #3
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
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>

Last edited by rblampain; 11-13-2007 at 11:04 AM.
 
Old 11-14-2007, 02:21 AM   #4
nc3b
Member
 
Registered: Aug 2005
Posts: 330

Rep: Reputation: 32
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.
 
Old 11-14-2007, 06:49 AM   #5
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
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.
 
Old 11-14-2007, 08:12 AM   #6
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
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.
 
Old 01-19-2013, 04:50 AM   #7
fhleung
Member
 
Registered: Aug 2004
Distribution: Lubuntu Live OS
Posts: 432

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
simple HTML page noir911 Programming 4 12-10-2006 03:19 PM
my web browser "mozilla fire fox" isn't rendering the page, rather opening the page amolgupta Linux - Software 2 07-26-2005 12:41 AM
php function to open an html page prabhatsoni Linux - Software 2 06-13-2005 11:32 PM
Include search criteria in results title page slackist LQ Suggestions & Feedback 3 12-10-2004 07:13 PM
Creating a simple html page from php? lucastic Linux - General 4 11-05-2003 08:48 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration