PHP在上传时中断
在我的WAMP服务器上,一切看起来都很好,脚本完全按照预期工作。当上传到服务器时,它什么也不提供,结果只是一个白色页面 我的主机关闭了php错误,所以我想知道为什么不会发生这种情况 编辑:添加整个页面代码PHP在上传时中断,php,Php,在我的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 regi
<?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";}
?>
这将删除带有选中复选框的所有行。
我正在为每个复选框使用此选项,如果有帮助的话。。。
我服务器上的PHP版本是5.2.17
我当前的WAMP版本是5.5.12
我无法想象这是一个版本,但这是我能想象的两个位置之间唯一的区别
还有人看到别的吗?如果是这个版本,关于如何使它与以前的版本兼容,有什么想法吗 最有可能的情况是,它符合您的第一个条件,并且可能是您正在尝试处理的get请求。为什么不试着在第一种情况下回应一些东西呢?如果isset$\u POST['delete']{echo No good;}检查服务器上的error.log或启用错误显示。ini设置“显示错误”,1;错误报告-1;请告诉我,这不仅仅是开放给任何人和每个人张贴到您的网页。也就是说,您可以使用ini_设置'display_errors',1为您的脚本重新启用错误和警告;错误报告e\u ALL;。将其添加到您怀疑出错的地方,如果有错误输出,则将其添加到PostAddError\u reportingE\u ALL;和ini设置“显示错误”,1;在脚本的开头,您应该看到发生了什么错误。@Mike'Pomax'Kamermans。。。我不是nooby haha,这是一个只有已建立的管理员才能访问的管理面板脚本: