Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File works with NS but not with IE.

Status
Not open for further replies.

Steve234

Technical User
Joined
Aug 19, 2003
Messages
2
Location
US
Hi everyone,

The php file below works ok in Netscape but not in IE. (I always thought IE was the more forgiving of the two browsers).

I just don't have any idea what the problem is. I've been told that its in the javascript by some php programmers, and a problem with the php by some javascript programmers. I have both Netscape6.2.1 and IE5.5 in my PC and it definitely works as expected in NS but crashes badly in IE. It also crashes with my webmaster's IE6.0 but not with his Netscape.

Through the process of elimination I believe I've determined the problem to be in either the header.php or PopOvers.php file called by the index.php file. (these and all associated files are also in the directory as .txt files so you can view the code in them by typing their name with a .txt extension). This page did work in both browsers as html and javascript but now as its converted to php, it will no longer work in IE.

To see the errors, click this link with your IE browser:


To see the index.php file as an index.txt file, you can use the link below:


I put a .txt version of all the associated php files in this directory, so to see the code in any of the associated files, just use the same name with a .txt extension.

Again, thank you for any help you can provide, and let me know if there is anything else I can do to help clarify the problem.

Steve
 
Index.php

You have:
<?
$title=&quot;Buy Any Battery Online Here&quot;;
$meta_description=&quot;.&quot;;
$meta_keywords=&quot;&quot;;
$date = date(&quot;F dS, Y&quot;);
include(&quot;header.php&quot;);
include(&quot;PopOvers.php&quot;);
include(&quot;top_links.php&quot;);
include(&quot;search_form.php&quot;);
include(&quot;nav_bar.php&quot;);
$sContent = <<<END_HTML
<!-- Begin Content Area -->
<TABLE cellpadding=10 width=&quot;100%&quot; bgcolor=white><TR><TD>

It should be
<?
$title=&quot;Buy Any Battery Online Here&quot;;
$meta_description=&quot;.&quot;;
$meta_keywords=&quot;&quot;;
$date = date(&quot;F dS, Y&quot;);
include(&quot;header.php&quot;);
include(&quot;PopOvers.php&quot;);
include(&quot;top_links.php&quot;);
include(&quot;search_form.php&quot;);
include(&quot;nav_bar.php&quot;);
$sContent = &quot;
<TABLE cellpadding=10 width=&quot;100%&quot; bgcolor=white><TR><TD>etc etc&quot;;

Infinity exists! - I just haven't worked out a way to get there yet.

| |
 
hi everyone and thanks for your input.

vbkris, yes, that is the error I'm talking about when I say it crashes in IE, but it works in Netscape.

sleipnir214, I don't consider it a javascript problem, because as javascript it works perfectly in any browser, but when I try to put it into php, thats when the errors/problems happen in IE. As a result, the &quot;javascript experts&quot; all claim its how I'm using php thats wrong.

ne4x4, danielhozac, I've passed your two comments to my webmaster and I will let you know what he says. I'll try it myself too, although I personally am not a php programmer.

Thank you all again.

steve
 
Steve,

If you want things to work cross-browser you should try to follow current HTML standards. Try to validate your page at the free w3c.org validator. As is, it will not even begin validating...
Think about it this way: If this business were to print a catalog, would they use ink that looks ok but smells like ****?

As for detecting the error with IE you need to look in the server logs to be able to determine where the abort happened. Otherwise it's just guessing.

You could also use a packet or network traffic inspecting tool to see what actually is transferred before the error appears.

I do not believe that PHP is at fault, it seems more likely to be something else.
 
Have you tried it replacing the HTML with something very simple? For example:

Code:
$sContent= <<<END_HTML
<p>Hello</p> tag
END_HTML;

Just to see if the error is in the HTML or the Heredoc formatting.

My guess is that your problem is a combination of JavaScript and PHP. Namely the PHP parser getting confused when trying to work it's way through the code and causing JavaScript to throw a wobbly. It could be down to something as simple as a misplaced quote or symbol that if interpreted incorrectly (or correctly depending how you look at it) changes the syntax of the JavaScript.


Also give it a go without using HereDoc syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top