我正在创建一个网站,我已经在XAMPP上测试了几个星期了,它一直在工作。但是,自从我将所有内容放入文件管理器(godaddy主机)后,我购买了域名和托管。突然,当我把它放在上下文中时,带有.php的文件无法读取php代码。或者至少它读取到第一行,但在php标签之外的所有内容(甚至是html代码)都是空的,页面显示为空白。我不知道为什么会发生这种情况,我现在已经搞砸了一段时间,似乎无法搞清楚!有人想拍吗?非常感谢!
<?php
session_start();
include($_SERVER["DOCUMENT_ROOT"].'/admin/classes/classes.php');
$log= new log($_SERVER["PHP_SELF"]);
if($_GET['logout']=='1'){
$sess = new SessionData();
$sess->Logout();
}
if($_SERVER['REQUEST_METHOD'] == "POST"){
$auth = new Authenticate();
extract($_POST);
if($auth->login($email,$pass)){
header('Location: index.php');
}else{
$error="<p class='red'>Invalid email or password.</p>";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<title>Login Page</title>
<style>
<!-- I took this part out because I didn't want anyone to compromise my project -->
</style>
<center>
<table border="0" cellpadding="0" cellspacing="0" class="bordertable" width="700">
<tbody>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" class="bottomborder" width="100%">
<tbody>
<tr>
<td bgcolor="#3B5998" width="350"><img src="../images/logo-left.jpg" /></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td><a href="index.php?PHPSESSID="><img border="0" src="../images/logo-right.jpg" /></a></td>
<td bgcolor="#3B5998" width="100%"> </td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tbody>
<tr height="21"><!--<td bgcolor=#3B5998 width=10> </td>-->
<td bgcolor="#3B5998" valign="bottom"> <a class="menu" href="../login.php?PHPSESSID=<?PHP echo session_id(); ?>">login</a></td>
<td bgcolor="#3B5998" valign="bottom"> <a class="menu" href="../register.php?PHPSESSID=<?PHP echo session_id(); ?>">register</a></td>
<td bgcolor="#3B5998" valign="bottom"> <a class="menu" href="../about.php?PHPSESSID=<?PHP echo session_id(); ?>">about</a></td>
<td bgcolor="#3B5998" width="100%"> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr>
<td valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="105">
<tbody>
<tr>
<td>
<table cellpadding="2" cellspacing="0" class="dashedtable" width="100%">
<tbody>
<tr>
<td align="right">
<p> </p>
<form action="login.php" method="post"><input name="PHPSESSID" type="hidden" value="<?PHP echo session_id(); ?>" /> Email:<br />
<input class="inputtext" name="email" size="20" type="text" /><br />
Password:<br />
<input class="inputtext" name="pass" size="20" type="password" />
<center><input class="inputsubmit" onclick="javascript:document.location='register.php';" type="button" value="register" /> <input class="inputsubmit" type="submit" value="login" /></center>
</form>
<!--<br>--></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td valign="top" width="595">
<table border="1" cellpadding="0" cellspacing="0" class="bordertable" width="100%">
<tbody>
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr>
<td bgcolor="#3B5998" class="white">Login</td>
</tr>
</tbody>
</table>
<center>
<table>
<tbody>
<tr>
<td><!--?PHP echo $error;?-->
<form action="login.php" method="post"><input name="PHPSESSID" type="hidden" value="<?PHP echo session_id(); ?>" /><br />
<br />
<br />
<br />
</form>
</td>
</tr>
</tbody>
</table>
</center>
</td>
</tr>
</tbody>
</table>
<center>
<p><a href="../about.php?PHPSESSID=& lt;?PHP echo session_id(); ?>">about</a> <a href="../contact.php?PHPSESSID=<?PHP echo session_id(); ?>">contact</a> <a href="../faq.php?PHPSESSID=<?PHP echo session_id(); ?>">faq</a> <a href="../terms.php?PHPSESSID=<?PHP echo session_id(); ?>">terms</a> <a href="../policy.php?PHPSESSID=<?PHP echo session_id(); ?>">privacy</a><br />
Developed by Fyre_Ph0x8<br />
PhyreByte Security Labs © 2013</p>
</center>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</center>
答案 0 :(得分:0)
您可以仔细检查所有包含文件的大小写。我在过去遇到过一些问题,生产服务器在文件名包含方面是区分大小写的,但我的本地测试服务器却没有。此外,您应该仔细检查您的PHP版本和配置文件是否在测试服务器和生产服务器之间匹配。