View Full Version : Buggy php include in IE6
mikmik
12-16-2003, 05:20 PM
I'm just getting into php so I wanted to rebuild my site using includes for the header, left nav, and footer. All seemed well untill I noticed a margin at the top of my page when viewed in IE6.
It doesn.t show up in Moz, however!
When I view source in IE, this cairrage return shows up between the <body> and <table> tags: <body> (here)
<table>, but not Moz.
This is the code :<body>
<? include("/assets/includes/header.php") ?>
<table border="0" cellpadding="0">
My html version is here - http://factor1.net/
here is php - http://factor1.net/blank.php
Question: Should I go back to bed and get up again?lol
Any one seen this before? Ive tried different charsets, can't think of anything else, I don't want to go 4.01 strict.
redcircle
12-16-2003, 06:10 PM
make sure it's putting out the same html.
php is not dependent on any browser all it does is output what you tell it. If you are getting differences it's because of the output code.
It looks like you are echoing some un-needed code. Post yer code and I'll help you troubleshoot.
mikmik
12-16-2003, 06:35 PM
Is this the code you mean? It's everything from 'header.php'-
<table width="100%" align="center" cellpadding="0" border="0">
<tr align="center" class="bdrwh">
<td width="153" class="bdrwh">/assets/images/general/smlogo.jpg (/index.htm)
</td>
<td class="bggrid">
<h1>websitedesigndevelopmentmaintenance</h1>
<div class="menoBar"> PLANS (/xdown/pack.php)
SAMPLES (/xdown/port.php) PROCESS (/xdown/howi.php)
SERVICES (/xdown/serv.php) STATS (/xdown/stat.php)
</div>
</td>
</tr>
</table>
The css is :
body{
font: small "Microsoft Sans Serif", Verdana, sans-serif;
color: #000033;
background: #FFFFFF;
padding: 0px;
margin: 0px;
}
And I'll bet I should have 0, instead of 0px.
Anyway, I just cut'n'paste, then included it.
mikmik
12-16-2003, 07:05 PM
When I changed the charset to =iso-8859-1, this "  " shows up in the top left of the page in both Moz and IE. I've had this problem before when I wasn't anywhere near php, but only noticed it in Mozilla last time.
In the 'view source' in IE, it shows up as the 'carraige return' rectangular '0' thing.
It has always shown up as the, uh, 'i'-'rightanglequote'-'upside-down question mark' thing in Moz, as it does now.
I think it is a bug in my Dreamweaver, I ocassionaly notice it in the 'design window' of my css sheet, but I can't for the life of me see it any other way.
What the %#@? :o)
Narasinha
12-17-2003, 12:22 AM
When I changed the charset to =iso-8859-1, this "  " shows up in the top left of the page in both Moz and IE. I've had this problem before when I wasn't anywhere near php, but only noticed it in Mozilla last time.
In the 'view source' in IE, it shows up as the 'carraige return' rectangular '0' thing.
It has always shown up as the, uh, 'i'-'rightanglequote'-'upside-down question mark' thing in Moz, as it does now.
I think it is a bug in my Dreamweaver, I ocassionaly notice it in the 'design window' of my css sheet, but I can't for the life of me see it any other way.
What the %#@? :o)
I see the same characters in Mozilla Firebird 0.7 and Opera 7, both as displayed and in the source. In Hex, they are characters #EF, #BB, #BF. I have no idea where they could be coming from. I suppose Dreamweaver is (for some reason) inserting some binary code into a sequence at some point.
I took a screen shot of the PHP page in Opera and posted it for you to look at: factor1.png (59k portable network graphic) (http://www.soltec.net/~dmg/factor1.png). I circled the odd characters as well as a vertical line that seemed out of place. I could barely see the top of it in the standard site, but the extra characters in the PHP version made more space for it. My screen size is 1024 x 768, but the window size is actually 850 x 641 (note the numbers at top left of graphic) due to the way I set up Opera. Other than the style sheet info, I don't see anything markedly different between the two version except the fact that the original version has the table begin immediately at the end of the body tag, where the PHP version has a line break (after the strange characters, of course) before the table begins.
Oddly enough, I did a Google search on the string of odd characters and got 16.4 million results. I couldn't find the characters in the pages that came up, either.
“Curiouser and curiouser!” Cried Alice (she was so much surprised, that for the moment she quite forgot how to speak good English).
mikmik
12-17-2003, 02:10 AM
Yes narasihna, got your 'heads up' from the break room, came over.
It is a weird one, I noticed it before on my old version (of this site) and was one reason I was starting over.
I'm not sure at all, but these are the things I've tried.
- If I change charsets to utf - 8, it disappears in Moz.
- I tried using notepad and typing it out from scratch, got a .css that was 3.971kb instead of 3.973, which could be due to an extra line of space
- I used an FTP app (FTP Commander) instead of Dreamweaver to upload
- I tried backspacing everything up snug to the closing head tag
- same as above except each to it's own line e.g.
</head>
<body>
<? ..etc.?>
<table> (the main table, I stack them, pure CSS soon)
I've had that single line thing as a cross browser issue using CSS before, maybe I should validate for CSS 1, I don't know!
I'm trying to take it step by step to xhtml/CSS, I've done several pretty reasonable 3 col. + header and footer layouts that way before, so I'll trial and erroring it for another day or two.
I also wiped my drive and reinstalled everything since I noticed it last time!
Narasinha
12-17-2003, 02:41 AM
It's definitely a frustrating problem. I've been working (now and then) on a template set for phpBB2, specifically, one that will meet XHTML strict standards, and will also meet WAI level 3 accessibility standards.
It's tough to be sure where all of the XHTML fits together when it's done by the PHP scripts. One script calls another one which includes this template file, then returns to the first script, which processes this, etc. etc.
I switched encoding (several) from my browser (in Opera) and got some other odd characters for replacements, but they never actually went away. I think it actually spelled something in Russian. I think it said ялц, which would be "yalts". Maybe it's a secret message in Dreamweaver from a dissident Russian programmer... ;)
cyanide
12-18-2003, 08:37 AM
hi mikmik,
First of all you need a semi-colon after the closing bracket in your echo syntax.
Also, I noticed you have an h1 tag in the html
That would create the extra space underneath
mikmik
12-18-2003, 09:50 AM
cyanide said :
hi mikmik,
First of all you need a semi-colon after the closing bracket in your echo syntax.
Also, I noticed you have an h1 tag in the html
That would create the extra space underneath
Now just because you built a computer from scratch, and troubleshot(?) a difficult problem to get it done, ON YOUR FIRST TRY EVER BUILDING ONE!!, doesn't mean that you know about php.
It just means CONGRATULATIONS!
It also means that you already know php anyways, thanks for the insight (echo charlie delta)
Roger, over and out :o)
[the part that starts "(echo charlie..."
isn't supposed to make sense, it's just the coffee kicking in lol]
mikmik
12-18-2003, 10:32 AM
I've included a photograph here to illustrate because the
'mystery character' won't show in the post otherwise -
http://factor1.net/temp/wpw/shite_001.gif
The rectangle (indicated with red arrow) is what
shows up in IE when I view source,
the green arrow indicates what shows in
Moz 'view source - only if my doc
charset is dif from browser setting!
They are what is causing the 'margin'
to appear at the top of my page,
before the content. It doesn't
happen in .html docs in IE, only
with the .php extension, however
it still can happen in Moz regardless!
Also, cyanide, the <h1> (red rectangle)
is SEO stuff and is block element so
always causes empty lines above and
beneath in rendered doc.
I'm with narasinha, it's a plot!