0

Possible Duplicate:
“Warning: Headers already sent” in PHP

I'm thinking that it might be because I have several header that sends to another more present in my class. and look like? since it does not bother sending me back '. wondering if you only have some javascript or jquery to just do it?.

But it is unbelievable that it does not bother to do it even though I have told it to do it even if I use ob_start (); and ob_end_flush ();. so bother it still does not make it ..

this is how I have build this building but it comes back and says that it did not bother because this:

Warning: Cannot modify header information - headers already sent by (output started at /home/jesperbo/public_html/mebe/function/function.php:479) in /home/jesperbo/public_html/mebe/function/function.php on line 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/');

            }
        }
    }

So where it retrieves the entire code for the page is here;

<?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();
?>

Hope you can help me?

Community
  • 1
  • 1
  • 5
    Stack Overflow is full of questions like this one. If you search the web on "php headers already sent", you will find many many pointers to a solution (like [this question](http://stackoverflow.com/questions/8028957/warning-headers-already-sent-in-php)). If output buffering doesn't solve it, perhaps there is a character in one of your files outside `` tags for example. Please show what you have tried, because this one looks like _"Dammit, it doesn't work, help me"_, and that's not how this site works. – CodeCaster Nov 15 '12 at 14:05
  • ooohhh Thank! im new in this site... – Jesper Petersen Nov 15 '12 at 14:06
  • 1
    You have output somewhere in your script before the header is sent, double check for echo, var_dump or print statements or whitespace before – max Nov 15 '12 at 14:10

0 Answers0