我的WAMP服务器上的一切看起来都很棒,而且脚本完全符合要求。当上传到服务器时,它什么都没有,只有一个白页。
我的主机已关闭php错误,所以我想知道为什么这不会发生。
编辑:添加了整个页面代码。
<?php
// When issuing a query "INSERT INTO users....", can use "NOW()" as a value to post "date entered" time, as well as "NULL" for UID to register auto incriment.
include_once("../ex/database.php"); //Includes a connection file.
include_once("../ex/defines.php");
session_start();
if(!isset($_SESSION["sess_user"])){
header("location:login.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Sermons | <?php print(COMPANY_name) ?></title>
<!-- INCLUDE STYLE SHEETS -->
<link href="css/reset.css" rel="stylesheet" type="text/css">
<link href="css/MasterStyles.css" rel="stylesheet" type="text/css">
<!-- INCLUDE HEAD PHP -->
<?php include("../ex/head.php")?>
<script type="text/javascript">
function confirmation(){
return window.confirm("Are you sure you want to delete selected sermons? \nThis cannot be undone.");
}
</script>
</head>
<body>
<header>
<?php include("inc/header.php")?>
</header>
<nav>
<?php include("inc/nav.php")?>
</nav>
<div class="content">
<p style="padding-top:10px;padding-bottom:10px;text-align:center;"><a href="addSermon.php">Add New Sermon</a></p>
<?php
$seriesno = mysqli_query($conn, "SELECT * FROM sermons WHERE series_id IS NULL");
echo "<table class='users'>
<form name='delete' method='post' action='".htmlentities($_SERVER['PHP_SELF'])."'>
<tr>
<th>Individual Sermons</th>
<tr>
<tr>
<th style='width:200px;'>Sermon Name</th>
<th style='width:150px;'>Preacher Name</th>
<th style='width:200px;'>Series</th>
<th style='width:100px;'>Date Preached</th>
<th style='width:100px;'>Date Added</th>
<th style='width:50px;'>Audio</th>
<th style='width:50px;'>Delete</th>
</tr>";
while($row = mysqli_fetch_array($seriesno))
{
echo "<tr>";
echo "<td><a href='editSermon.php?id=" . $row['id'] . "'>" . $row['sermon_name'] . "</a></td>";
echo "<td>" . $row['preacher'] . "</td>";
echo "<td>" . $row['series_id'] . "</td>";
echo "<td>" . $row['date_preached'] . "</td>";
echo "<td>" . $row['date_added'] . "</td>";
if($row['audio_file']!==NULL){
echo "<td>" . $row['audio_file'] . "</td>";
} else {
echo "<td>N/A</td>";
}
echo "<td><input name='checkbox[]' type='checkbox' id='checkbox[]' value='" . $row['id'] . "'></td>";
echo "</tr>";
}
echo "<tr>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td><input name='delete' type='submit' id='delete' value='Delete' onclick='return confirmation()'></td>";
echo "</tr>";
echo "</table>";
$seriesres = mysqli_query($conn, "SELECT * FROM sermons WHERE series_id IS NOT NULL ORDER BY series_id DESC");
echo "<table class='users'>
<tr>
<th>Sermon Series</th>
<tr>
<tr>
<th style='width:200px;'>Sermon Name</th>
<th style='width:150px;'>Preacher Name</th>
<th style='width:200px;'>Series</th>
<th style='width:100px;'>Date Preached</th>
<th style='width:100px;'>Date Added</th>
<th style='width:50px;'>Audio</th>
<th style='width:50px;'>Delete</th>
</tr>";
while($row = mysqli_fetch_array($seriesres))
{
//<a href='editSermon.php?id=" . $row['id'] . "'>Edit User</a>
//<a href='removeSermon.php?id=" . $row['id'] . "' onclick='return confirmation()'>Delete User</a>
echo "<tr>";
echo "<td><a href='editSermon.php?id=" . $srow['id'] . "'>" . $srow['sermon_name'] . "</a></td>";
echo "<td>" . $srow['preacher'] . "</td>";
echo "<td>" . $srow['series_id'] . "</td>";
echo "<td>" . $srow['date_preached'] . "</td>";
echo "<td>" . $srow['date_added'] . "</td>";
if($srow['audio_file']!==NULL){
echo "<td>" . $srow['audio_file'] . "</td>";
} else {
echo "<td>N/A</td>";
}
echo "<td></td>";
echo "</tr>";
}
echo "<tr>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td><input name='delete' type='submit' id='delete' value='Delete' onclick='return confirmation()'></td>";
echo "</tr>";
echo "</form></table>";
?>
</div>
<span class="bottom">Logged in as <?=$_SESSION['sess_user'];?>. <a href="logout.php">Logout</a></span>
</body>
</html>
<?php
if(!isset($_POST['delete'])){
echo "Try";
}
if(isset($_POST['delete'])){
// If delete button is pressed...
if (count($_POST['checkbox']) > 0) {
foreach ($_POST['checkbox'] as $del_id) {
$delsql = "DELETE FROM sermons WHERE id=' " . $del_id . " ' ";
$delres = mysqli_query($conn, $delsql);
if($row['audio_file']!==NULL){
// unlink($row['audio_file']);
// } else {
// echo "Attached file could not be deleted. Make sure you delete ".$row['audio_file']." manually!";
}
if(mysqli_affected_rows($conn) > 0){
header: ("location:index.php");
} else {echo "nope";}
}
} else {echo "nope";}
} else {echo "nope";}
?>
这应该使用选中的&#34;复选框删除所有行。&#34; 如果有帮助的话,我会在每个复选框中使用它
我服务器上的PHP版本是5.2.17
我目前的WAMP版本是5.5.12
我无法想象它是版本,但它是我在两个地点之间可以想象的唯一区别。
有没有人看到别的什么?如果是版本,有关如何使其与先前版本兼容的任何想法?