View previous topic :: View next topic |
Author |
Message |
wickford -
Joined: 21 Aug 2003 Posts: 9
|
Posted: Wed Jan 24, 2007 6:13 pm Post subject: IE and include() |
|
|
Hi,
For whatever reason, whenever I try to use include(), IE is inserting a stray character that is breaking my layout. There is no problem with Firefox or any other browser.
Here is the screenshot in Firefox. The coloured boxes represent places where background images will go.
Here is the screenshot in IE (with the character highlighted)
I downloaded the pre-configured PHP5 package on this website (from here). I followed all the instructions on it carefully.
Any help on this will be appreciated. Thanks. |
|
Back to top |
|
 |
roganty -
Joined: 08 Jun 2004 Posts: 357 Location: Bristol, UK
|
Posted: Wed Jan 24, 2007 7:40 pm Post subject: |
|
|
In your PHP code an additional new line is being added into the HTML which Firefox is disregarding, but IE is rendering
Here are two examples:
Code: | <div>
<div>
somestuff
</div>
</div> |
Code: | <div><div>something</div></div> |
Both are the same, only one is all on one line, but when it is rendered there will be additional spaces on one _________________ Anthony R
Roganty | Links-Links.co.uk |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Jan 24, 2007 8:15 pm Post subject: |
|
|
As far as ive noticed DIV will always make a <br> after it. SPAN (which works the same as DIV) does not make a <br> after it. Try using SPAN instead of DIV. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
wickford -
Joined: 21 Aug 2003 Posts: 9
|
Posted: Wed Jan 24, 2007 8:27 pm Post subject: |
|
|
It's not because of spaces in the code, I've already tried that. And changing the DIV to SPAN doesn't remove the character. IE is inserting a dot-like character just before where I typed the <?php.
Here is the code with the PHP:
Code: | <div class="content">
<div class="menu"><?php
include("menu.php");
?></div> |
And here is the result generated by IE, from the view source option (made a screenshot because it's difficult to see on the forum):
 |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Jan 24, 2007 8:34 pm Post subject: |
|
|
What file encoding are you using? This may have an effect. Check the class "menu" also. Maybe that contains an error. If else fails, try re-writing the code and see if the same error persists. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
wickford -
Joined: 21 Aug 2003 Posts: 9
|
Posted: Wed Jan 24, 2007 8:47 pm Post subject: |
|
|
I'm using UTF-8 for both index.php and menu.php.
I'm sure I saved them that way at the start, but I'll retype the code anyway to see if it works.
edit: I've typed some quick php files and saved them with utf-8, still no luck. The symbol is still appearing when I try to use include().
I've using MS Notepad if it matters. |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Jan 24, 2007 8:55 pm Post subject: |
|
|
Can you send me the file so I can test it? webmaster [at] abyssunderground [dot]co.uk _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
wickford -
Joined: 21 Aug 2003 Posts: 9
|
Posted: Wed Jan 24, 2007 9:23 pm Post subject: |
|
|
*(link removed)*. thanks for helping.
Last edited by wickford on Wed Jan 24, 2007 10:50 pm; edited 1 time in total |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Jan 24, 2007 9:28 pm Post subject: |
|
|
Resave the files as ANSI. All mine are saved as ANSI. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
wickford -
Joined: 21 Aug 2003 Posts: 9
|
Posted: Wed Jan 24, 2007 9:38 pm Post subject: |
|
|
Well, it works. Thanks for the help you've given me.
But is there a way to get them to work with UTF-8? As I said I'm using Notepad, does that affect anything? |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Jan 24, 2007 9:58 pm Post subject: |
|
|
I don't know. UTF-8 is a different encoding and is often where people have problems. We've had issues in the past with people saving as UTF-8 instead of ANSI. Their issues were solved by saving with ANSI. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
wickford -
Joined: 21 Aug 2003 Posts: 9
|
Posted: Wed Jan 24, 2007 10:10 pm Post subject: |
|
|
I see. OK, I'll make do with ANSI.
Thanks again. |
|
Back to top |
|
 |
|