views:

938

answers:

6

I am building an online article website. I have a php script called view_article.php that displays articles. The way the page knows what article to show is by using a $_GET variable in the URL.

For example:

/view_article.php?article_id=1  views article 1
/view_article.php?article_id=2  views article 2

Here's the catch. In IE8 when I view article 1, the page displays fine, but when I view article 2, IE displays the page as blank. It's running the same script so how/why is it displaying the page as blank?

Of the 4 computers I have tried this on, it can be reproduced 100% of the time on 2 of the 4 computers and it never happens on the other 2 computers. Firefox and Chrome have no problems displaying the pages.

I have all error messages turned on but nothing is displayed

Any ideas on why this is happening and how I can fix it? It is not only those article pages that aren't working but other pages on the site don't work as well (maybe 10% of about 50 different php script pages don't work in IE8 consistenly on those 2 computers and one of those pages is my registration page). What can I do? I'm worried that 10% of my users won't be able to access my website. The majority of users of the site will be using IE. Thanks for any suggestions

EDIT

View Source Some helpful people suggested to view the source. Viewing the source on the computer that shows blank vs the computer that shows the page properly is almost identical except the computer that shows blank has some garbled characters that show after the last tag. I'm not doing anything to do with anything Turkish and also the computers giving me problems are in Taiwan and the browsers are in Mandarin (Chinese).

 ` ` ? ?¢F @ ? ? ? ??¨t?0 ?? ?�Ã? ? ? $ ? ???Psprog Psprog Regular Turkish uropean ðK? ¡I?$ W ? ` ` ? ?¢F @$? ? ? �ü ģ ?? ?�Ã? ? ? ? ???·s�ө��é ·s�ө��é Regular Turkish uropean ðK? ¡I? ? ` ` ¢D�¼ ?¢F @ ? ? ? ? �Ã? ? ? ? 

HTTP Headers Someone suggested examining the headers. I don't really know what I'm looking for so I used web-sniffer. Here is the output:

HTTP REQUEST HEADERS
Connect to 66.147.230.147 on port 80 ... ok

GET /articles/trends HTTP/1.1[CRLF]
Host: www.example.com[CRLF]
Connection: close[CRLF]
User-Agent: Web-sniffer/1.0.29 (+http://web-sniffer.net/)[CRLF]
Accept-Encoding: gzip[CRLF]
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
Cache-Control: no[CRLF]
Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF]
Referer: http://web-sniffer.net/[CRLF]
[CRLF]


HTTP RESPONSE HEADERS
HTTP Status Code: HTTP/1.1 200 OK
Date:   Thu, 20 Aug 2009 07:06:40 GMT 
Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 
X-Powered-By:   PHP/5.2.9 
Expires:    Thu, 19 Nov 1981 08:52:00 GMT 
Cache-Control:  no-store, no-cache, must-revalidate, post-check=0, pre-check=0 
Pragma: no-cache 
Set-Cookie: PHPSESSID=1e8520adc7a127590d4f59cb37ca0c98; path=/ 
Connection: close 
Transfer-Encoding:  chunked 
Content-Type:   text/html
+1  A: 

Maybe ie had some plugins like banner Blocker?

x2
Thanks for the suggestion. We do not have any form of advertisement (no banners) on the site. Do you know of any other sorts of plugins that would cause this behaviour?
justinl
I had a problem with one of antiviruses, cause it was word "banner" in url, so it was the same balnk page.
x2
It's happening on various pages such as:example.com/registerexample.com/articles/interviewsexample.com/workshopso I'm thinking it's not a "blocking" issue.
justinl
+1  A: 

I've never seen this before - here are some debugging tips. Give me the URL and I'll try it live.

1) See if you're getting back HTML (view source, use a wire sniffer)

2) If you are getting back HTML, it's probably something doing a document.write after the page is loaded. Overwrite document.write and see who is calling it:

<script>
  var old = document.write;
  document.write = function(){
    printStackTrace();
    old.call(document);
  }
<script>

Here is code to print a stack trace: http://eriwen.com/javascript/js-stack-trace/

Steve Brewer
I'm not using any Javascript on the entire page. Could it still be a document.write problem?
justinl
I tried that javascript stacktracer. Nothing happens when I load the page in IE. It shows blank as usual. If I load the page in FireFox a popup shows that says "anonymous".
justinl
+1  A: 
  1. That weird output that you see in IE - looks suspiciously like a font to me. Are you embedded any fonts on that page? Try disabling/commenting out that for now and see if it makes a difference.

  2. Can I also suggest that you validate your HTML here:

http://validator.w3.org/#validate%5Fby%5Finput

See if there are any obvious errors that prevent IE from rendering it. Plus - which version of IE do you test it with?

3.Script tags. If your output is xthml and you use this syntax:

<script ..../>

try changing it to:

<script ...>your script</script>

4.META tags with the content-type

Remove and use PHP to add it in the header:

header("content-type:....")

DmitryK
I have had some blank page issues lately related to fonts.
DGM
A: 

Rather than capturing a snapshot of traffic which doesn't match what the browser gets, you should check to see exactly what the browser is getting. Use Fiddler (www.fiddler2.com) for this purpose.

This will also allow you to capture a log file (SAZ/Session Archive Zip format) and share it with others so we can see exactly what you see.

My guess is that your HTTP Response is malformed and polluting the socket for the subsequent request.

EricLaw -MSFT-
A: 

Thanks everyone for your help. I ended up solving this problem after all. Here is what happened for those who wish to know the answer or have a similar problem:

The website I am developing for is in Taiwan (and I'm a North American developer). This blank IE page was only happening on the computer in Taiwan using IE. I discovered that to replicate this test environment I had to switch my windows regional settings to Chinese (Taiwan). The allowed me to reproduce the bug on my local machine in canada.

Next, I discovered the reason that IE was not displaying the page was because the default IE encoding was Chinese Traditional (Big5). The encoding needed to be switched to UTF-8 in order for the page to display.

Therefore I forced the encoding on my .htaccess file by using: AddDefaultCharset UTF-8 (only specifying the charset in the meta tag in html did not work because it was already set to utf-8).

justinl
A: 

Many thanks, I had exactly the same problem (also based in Taiwan). The browser didn't seem to auto-detect utf-8 without the .htacccess file.

That solved the problem for me so thanks again!

Malcolm
I'm glad someone else has benefited from this! I know it was driving me crazy for a while there :P
justinl