所以我有一个 .php 网页,它在顶部包含一个用于登录系统的 PHP 脚本。下面是显示网页的 HTML。现在在 Firefox 或 chrome 中显示正常,但在 Internet Explorer 中该网站看起来令人震惊。我发现删除 PHP 后格式是正确的。这是页面顶部使用的 PHP 代码:
<?php
session_start();
if(!session_is_registered(myusername)){
header("location:http://www.mvaeng.com.au/Login");
}
$myusername = $_SESSION["myusername"];
$mypassword = $_SESSION["mypassword"];
$host="localhost"; // Host name
include 'DATA.php';
$db_name="mvaengco_Loginsystem"; // Database name
$tbl_name="Members"; // Table name
mysql_connect("$host", "$username", "$password")or
die(mysql_error());
mysql_select_db("$db_name")or die(mysql_error());
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and
password='$mypassword'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if(!($count==1)){
header("location:http://www.mvaeng.com.au/Login");
}
$htaccess = 'Files/.htaccess';
$ip .= $_SERVER['REMOTE_ADDR'];
$line1ht .= "order deny,allow \r\n";
$line2ht .= "deny from all \r\n";
$line3ht .= "allow from $ip \r\n";
file_put_contents($htaccess, $line1ht);
file_put_contents($htaccess, $line2ht, FILE_APPEND | LOCK_EX);
file_put_contents($htaccess, $line3ht, FILE_APPEND | LOCK_EX);
?>
以及 PHP 代码下面的 HTML 代码的第一部分:
<head>
<title>Client File System - Logged In</title>
<meta charset="utf-8">
<link href="http://mvaeng.com.au/css/reset.css" rel="stylesheet" type="text/css" />
<link href="http://mvaeng.com.au/css/layout.css" rel="stylesheet" type="text/css" />
<link href="http://mvaeng.com.au/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://mvaeng.com.au/js/dropdown.js"> </script>
<script src="http://code.jquery.com/jquery-1.8.1.min.js" type="text/javascript"></script>
<script src="jquery.easing.js" type="text/javascript"></script>
<script src="jqueryFileTree.js" type="text/javascript"></script>
<link href="jqueryFileTree.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
var x="../../MASTER/Files/";
function openFile(file) {
var fileA=file.replace("/","/BIN_1/");
window.location = fileA;
}
$(document).ready( function() {
$('#fileTree').fileTree({ root: '../../BIN_1/Files/', script: 'connectors/jqueryFileTree.php' }, function(file) {
openFile(file);
});
});
</script>
</head>
那么,我该如何解决这个问题?
谢谢!