dourou9477 2012-03-08 15:41
浏览 43
已采纳

由于PHP类,Internet Explorer无法正确呈现页面

I have a very strange problem and i don't know what to do about it. My site seems to work just fine all browsers other than internet explorer, so i've been trying to figure out why.

I've narrowed it down to the a file that I'm including in my site, this file is a php class that has a number of different functions like login getters and setters and so on.

I took all the php code out of my pages and it renders fine, so i added the php back in line by line and released that it stopped working when i used this:

 require_once 'classes/Membership2.php';

Does anyone know why some php code will be messing with the style of my website.

For more detail on the matter, i have a number of divs that are centered, they all have curved edges as well as shadows. So by taking away the php i can see that IE is loading the page properly, no incompatibilities or anything like that.

Has anyone had a problem like this before? While i'm waiting for an aswesome or two i'll be removing functions and part of the code till i can narrow it down. (I would give code, but the file has a lot of lines of code.)

Thanks for the help.

Oh yeah and I'm testing on Internet Explorer 9 and every other browser is the latest version or close enough.

Okay so i've done some more digging into this, i've found that if i delete all the code in the class (All the functions) and leave just and empty class in the include file it still doesn't work. Okay, so in my view that means the functions aren't whats making this problem. So i deleted EVERYTHING, so now the include points to a blank php file. This worked and the page rendered as it should but obviously there is no functionality, i can't login or anything like that. I decided to add a constructor instead of leaving it as default, this function does nothing but return true; and it made the site mess up again.

Does this info change anything? Also i'm reiterating the fact that i do not get this error or any other browser but Internet Explorer 9 (Haven't tried any other IE version).

Thanks again for the help.

Okay, so i've solved the problem. At the start of my PHP class i have used

 <!-- blah blah blah -->

forgetting that there is only PHP in this document and no HTML. So when i include the file it just outputs that into my source code and and messes things up, should have used the PHP commenting style.

Still strange that EVERY browser other than IE just ignores this and goes about its business, even the site that @blankabout suggested didn't give me any error (Although i assure thats because its part of the included PHP file and not the HTML itself).

  • 写回答

2条回答 默认 最新

  • dougengqiu8031 2012-03-09 11:48
    关注

    as @fajran says to you, save both outputs with "view source code" on the browser and compare them to find the diference. To compare outputs use winmerge or similar tool. Once you now which text it generating the trouble, modify it inside the include file.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用