Having trouble with include command in IE (FF works fine)

Reply

Join Date: Feb 2007
Posts: 26
Reputation: poslanik is an unknown quantity at this point 
Solved Threads: 0
poslanik poslanik is offline Offline
Light Poster

Having trouble with include command in IE (FF works fine)

 
0
  #1
Mar 7th, 2007
Hi,

I'm having a classic 'doesn't work in IE but works in FF' problem.

I have a site http://learn-croatian.com/apdejt and I wanted to make it easier for me to update metas in all pages with help from php. I'd change the php variables in a central file which is included in every page. Here's what I did:

  1. <?php include ("meta.txt"); ?>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  3. <html lang="en">
  4. <head>
  5. <title><?php echo "$naslov"; ?>Homepage</title>
  6. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  7. <meta name="description" content="<?php echo "$opis"; ?>" />
  8. <meta name="keywords" content="<?php echo "$kljucne"; ?>"/>
  9. <meta name="author" content="<?php echo "$autor"; ?>" />
  10. <link rel="stylesheet" type="text/css" href="style.css" />
  11. <meta name="copyright" content="Learn-Croatian.com" />
  12. <meta http-equiv="content-language" content="en, hr" />
  13.  
  14. <!--[if IE]>
  15. <style type="text/css">
  16. * html .ex{padding-bottom:32767px;margin-bottom:-32767px;}
  17. </style>
  18. <![endif]-->
  19. </head>

Here is the meta.txt file:

  1. <?php
  2. $opis="Learn-Croatian.com is the site for grasping the basics of the Croatian language for free!";
  3. $kljucne="horvatsko, chorvatsko, book, croatian, lessons, lesson, adjectives, verbs, nouns, pronouns, croatia, language, hrvatski, hrvatska, croatian, jezik, learn, free, phrasebook, phrases, recordings, translations, tourist, tourism, holidays, vacations, trips, istria, istra, slavonija, slavonia, dalmatia, dalmacija, zagreb, no, charge, online, trips, vacations, holidays, kroatiska";
  4. $naslov="Learn Croatian for free | ";
  5. $autor="Tomislav - contact@learn-croatian.com";
  6. ?>

Well, it doesn't work in IE 6. Please hit the link I gave above with FF and IE both. You'll see what I'm talking about. However, if I don't use the include command and just insert the code from the meta.txt file everything works fine (except the fact that the picture in the header is pushed down too much which can be seen with IE even now). But if I do that, I'll have to modify each page manually when I want to change the metas one day.

Please help!
Last edited by poslanik; Mar 7th, 2007 at 12:35 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 232
Reputation: Rhyan is an unknown quantity at this point 
Solved Threads: 24
Rhyan's Avatar
Rhyan Rhyan is offline Offline
Posting Whiz in Training

Re: Having trouble with include command in IE (FF works fine)

 
0
  #2
Mar 7th, 2007
Hi there,

I did not notice any problem here. Please note code as rendered from IE, FF and Opera 9


Opera:
<meta name="description" content="Learn-Croatian.com is the site for grasping the basics of the Croatian language for free!" />
<meta name="keywords" content="horvatsko, chorvatsko, book, croatian, lessons, lesson, adjectives, verbs, nouns, pronouns, croatia, language, hrvatski, hrvatska, croatian, jezik, learn, free, phrasebook, phrases, recordings, translations, tourist, tourism, holidays, vacations, trips, istria, istra, slavonija, slavonia, dalmatia, dalmacija, zagreb, no, charge, online, trips, vacations, holidays, kroatiska"/>
<meta name="author" content="Tomislav - contact@learn-croatian.com" />
<link rel="stylesheet" type="text/css" href="style.css" />
<meta name="copyright" content="Learn-Croatian.com" />
<meta http-equiv="content-language" content="en, hr" />

IE 6 winxpsp2:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="Learn-Croatian.com is the site for grasping the basics of the Croatian language for free!" />
<meta name="keywords" content="horvatsko, chorvatsko, book, croatian, lessons, lesson, adjectives, verbs, nouns, pronouns, croatia, language, hrvatski, hrvatska, croatian, jezik, learn, free, phrasebook, phrases, recordings, translations, tourist, tourism, holidays, vacations, trips, istria, istra, slavonija, slavonia, dalmatia, dalmacija, zagreb, no, charge, online, trips, vacations, holidays, kroatiska"/>
<meta name="author" content="Tomislav - contact@learn-croatian.com" />
<link rel="stylesheet" type="text/css" href="style.css" />
<meta name="copyright" content="Learn-Croatian.com" />
<meta http-equiv="content-language" content="en, hr" />

FFOX 2.0.2:

<meta http-equiv="content-type" content="text/html; charset=windows-1250" />
<meta name="description" content="Learn-Croatian.com is the site for grasping the basics of the Croatian language " />
<meta name="keywords" content="horvatsko, chorvatsko, book, croatian, lessons, lesson, adjectives, verbs, nouns, pronouns, croatia, language, hrvatski, hrvatska, croatian, jezik, learn, free, phrasebook, phrases, recordings, translations, tourist, tourism, holidays, vacations, trips, istria, istra, slavonija, slavonia, dalmatia, dalmacija, zagreb, no, charge, online" />
<meta name="author" content="Tomislav - nomad2389@gmail.com" />
<link rel="stylesheet" type="text/css" href="style.css" />
<meta name="copyright" content="Learn-Croatian.com" />Are you sure you were looking the source of the same file? It seems OK.
Note that normally it is the PHP parser that passes the info to the browser, so if any problem occurs it should be php / serverside related, rather than a browser problem.

Cheers!
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 232
Reputation: Rhyan is an unknown quantity at this point 
Solved Threads: 24
Rhyan's Avatar
Rhyan Rhyan is offline Offline
Posting Whiz in Training

Re: Having trouble with include command in IE (FF works fine)

 
0
  #3
Mar 7th, 2007
p.s. Do you have some code prior the DOCTYPE declaration.

There is some symbol there, that causes the "pushing down" of the picture. It is a line break, or a dot, or something like that, so it distorts the code a bit.
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 26
Reputation: poslanik is an unknown quantity at this point 
Solved Threads: 0
poslanik poslanik is offline Offline
Light Poster

Re: Having trouble with include command in IE (FF works fine)

 
0
  #4
Mar 8th, 2007
Yes I do have a piece of code before DOCTYPE, I've said so in my initial post. However, in Firefox it looks fine. I don't know why everything is ok in your IE, because in mine it looks like this (the third column starts after the fold):

http://img.photobucket.com/albums/v1...sta/skrini.jpg

The code you pasted looks fine (the metas are ok and everything) but I can't get it to work in IE. Could you please take a screenshot of the site while viewing it with IE?
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 26
Reputation: poslanik is an unknown quantity at this point 
Solved Threads: 0
poslanik poslanik is offline Offline
Light Poster

Re: Having trouble with include command in IE (FF works fine)

 
0
  #5
Mar 8th, 2007
P.S. I just had my friend take a screenshot of the site in IE and it came out same as mine. He's having problems too.

Does anyone know why including files with php screwes up pages in IE?
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 232
Reputation: Rhyan is an unknown quantity at this point 
Solved Threads: 24
Rhyan's Avatar
Rhyan Rhyan is offline Offline
Posting Whiz in Training

Re: Having trouble with include command in IE (FF works fine)

 
0
  #6
Mar 8th, 2007
Originally Posted by poslanik View Post
P.S. I just had my friend take a screenshot of the site in IE and it came out same as mine. He's having problems too.

Does anyone know why including files with php screwes up pages in IE?
Hm... I saw what you mean - I have opened http://learn-croatian.com/ and it is OK.

Now, what I have noticed is that there are some invalid characters in your code on several places. But I doubt that it is the main reason for having it all distorted like that.

I see you have some number of improperly closed divs, that may be the reason for such distortion. I will take a closer look, and will advise, meantime, do you use a tool like dreamweaver, or something else to edit the page?
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 26
Reputation: poslanik is an unknown quantity at this point 
Solved Threads: 0
poslanik poslanik is offline Offline
Light Poster

Re: Having trouble with include command in IE (FF works fine)

 
0
  #7
Mar 8th, 2007
No, I code in notepad. You opened the wrong address you need to open the apdejt folder.

P.S. I received your PM, we'll talk over ICQ.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 19
Reputation: mediaphyte is an unknown quantity at this point 
Solved Threads: 0
mediaphyte mediaphyte is offline Offline
Newbie Poster

Re: Having trouble with include command in IE (FF works fine)

 
0
  #8
Mar 9th, 2007
Well, one thing I've noticed with PHP & IE... (Well, to be more precise: the HTML that results in our use of PHP)... is....
The first line actually sends a newline to the browser before continuing to the DOCTYPE line. If we put a <? php line here ?>we might want to continue the rest of the html directly after the php closing since sometimes a newline throws off a structured graphic design.

mediaphyte dot com
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 26
Reputation: poslanik is an unknown quantity at this point 
Solved Threads: 0
poslanik poslanik is offline Offline
Light Poster

Re: Having trouble with include command in IE (FF works fine)

 
0
  #9
Mar 10th, 2007
I saved the files in UTF without BOM and everything's working fine. Thanks anyway.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC