警告:无法修改标头信息 - 已在F:\ Proiecte \ Aplicatie \ Laravel 5.2 \ test5 \ pagination_curent_b中发送的标头(在F:\ Proiecte \ Aplicatie \ Laravel 5.2 \ test5 \ pagination_curent_b.php:100中开始输出)第113行的.php
<html>
<head><title></title></head>
<body>
<?php
include('config.php');
$page = $_GET['page'];
if (isset($_POST['prev'])) {
if ($page > 1) {
$page--;
echo "Prev: $page";
header("location:pagination_curent_b.php?page=$page");
} else {
header("location:pagination_curent_b.php?page=$page");
}
}
echo $page;
echo "<br><hr><br>";
if ($page == "" || $page == "1") {
$page1 = 0;
} else {
$page1 = ($page * 12) - 12;
}
$increment_curent_b = 1;
$sql = "SELECT * FROM weather_curent_b limit $page1,12";
if ($result = mysqli_query($db, $sql)) {
if (mysqli_num_rows($result) > 0) {
echo '<table style="text-align: center;">';
echo "<tr>";
echo "<th>Nr.Crt</th>";
echo "<th>Country</th>";
echo "<th>City</th>";
echo "<th>Hour</th>";
echo "<th>Min</th>";
echo "<th>Max</th>";
echo "<th>Img</th>";
echo "<th>Forecast</th>";
echo "<th>Chill</th>";
echo "<th>Direction</th>";
echo "<th>Speed</th>";
echo "<th>Humidity</th>";
echo "<th>Pressure</th>";
echo "<th>Rising</th>";
echo "<th>Visibility</th>";
echo "<th>Date</th>";
echo "<th>Day</th>";
echo "</tr>";
while ($row = mysqli_fetch_array($result)) {
echo "<tr>";
//echo "<td>" . "$increment_curent_b" . "</td>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['Country'] . "</td>";
echo "<td>" . $row['City'] . "</td>";
echo "<td>" . $row['Hour'] . "</td>";
echo "<td>" . $row['Min'] . "</td>";
echo "<td>" . $row['Max'] . "</td>";
echo "<td>" . $row['Img'] . "</td>";
echo "<td>" . $row['Forecast'] . "</td>";
echo "<td>" . $row['Chill'] . "</td>";
echo "<td>" . $row['Direction'] . "</td>";
echo "<td>" . $row['Speed'] . "</td>";
echo "<td>" . $row['Humidity'] . "</td>";
echo "<td>" . $row['Pressure'] . "</td>";
echo "<td>" . $row['Rising'] . "</td>";
echo "<td>" . $row['Visibility'] . "</td>";
echo "<td>" . $row['Date'] . "</td>";
echo "<td>" . $row['Day'] . "</td>";
echo "<td><a href='edit_curent_b.php?id=" . $row['id'] . "'>Edit</a></td>";
echo "<td><a href='delete_curent_b.php?id=" . $row['id'] . "'>Delete</a></td>";
echo "</tr>";
//$increment_curent_b++;
}
echo "</table>";
// Close result set
mysqli_free_result($result);
} else {
echo "No records matching your query were found.";
}
} else {
echo "ERROR: Could not able to execute $sql. " . mysqli_error($db);
}
$res1 = mysqli_query($db, "select * from weather_curent_b");
$cou = mysqli_num_rows($res1);
$a = $cou / 12;
$a = ceil($a);
$next = $a;
echo "<br><br>";
?><form method="post" action=""><?php
?><input type="submit" name="prev" value="prev"/><?php
for ($b = 1; $b <= $a; $b++) {
?><a href="pagination_curent_b.php?page=<?php echo $b; ?>" style="text-decoration: none;"><?php echo $b . " "; ?></a><?php //**This line**
}
?><input type="submit" name="next" value="next"/><?php
?></form><?php
$b = $b - 1;
echo "\$b: $b" . "<br>";
if (isset($_POST['next'])) {
if ($page < $next) {
$page++;
header("location:pagination_curent_b.php?page=$page");//**This line**
} else {
echo $page;
header("location:pagination_curent_b.php?page=$page");//**This line**
}
}
?>
</body>
</html>