0

可能重复:
PHP 中的“警告:标头已发送”

我在想这可能是因为我有几个标题发送到我班上的另一个人。看起来像?因为它不会费心把我送回去'。想知道您是否只有一些 javascript 或 jquery 才能做到这一点?

但令人难以置信的是,即使我已经告诉它去做,即使我使用 ob_start(); 它也不费心去做。和 ob_end_flush ();。所以打扰它仍然没有成功..

这就是我建造这座建筑的方式,但它回来并说它没有打扰,因为:

警告:无法修改标头信息 - 标头已由(输出开始于 /home/jesperbo/public_html/mebe/function/function.php:479)在 /home/jesperbo/public_html/mebe/function/function.php 第 404 行发送

 function img_ok_upload(){
        if($_SESSION["logged_in"] = true && $_SESSION["rank"] == 1 || $_SESSION["rank"] == 2)
        {
            include "function/class.upload.php";
            $handle = new Upload($_FILES["filename"]);

            if($handle->uploaded)
            {
                //lidt mere store billeder
                $handle->image_resize = true;
                $handle->image_ratio_y = true;
                $handle->image_x = 220;
                $handle->Process("gallery/store");

                //til profil billede lign..
                $handle->image_resize = true;
                $handle->image_ratio_crop = true;
                $handle->image_y = 115;
                $handle->image_x = 100;
                $handle->Process("gallery");

                //til profil billede lign..
                $handle->image_resize = true;
                $handle->image_ratio_crop = true;
                $handle->image_y = 75;
                $handle->image_x = 75;
                $handle->Process("gallery/lille");
                $pb = $handle->file_dst_name;

            }
            if ($stmt = $this->mysqli->prepare('INSERT INTO `gallery` (`title`, `id_bruger`) VALUES (?, ?)'))
            {

                $stmt->bind_param('si', $title, $id_bruger);
                $title = $pb;
                $id_bruger = $_SESSION["id"];

                $stmt->execute();
                $stmt->close();

                header('Location: /nyeste-billeder/');

            }
        }
    }

因此,它检索页面的整个代码的位置就在这里;

<?php 
session_start();
require_once ("function/function.php");
$mebe = new mebe;
$db = $mebe->db_c();
ob_start();

$img_ok_upload = $mebe->img_ok_upload();

ob_end_flush();
?>

希望你能帮我?

4

0 回答 0