What's missing from these image headers?

Discussion in 'PHP' started by sarahk, Nov 8, 2011.

  1. #1
    I'm working on a site which is showing images that are parsed

    Example Page: http://www.findmyrental.co.nz/adlistings/view/117
    Example Image: http://members.nzpif.org.nz/adimages/thumb/151

    If I view the page in IE, Chrome, Safari and Opera its fine.
    If my husband views it in Firefox its fine

    If I view it in Firefox the images are all hidden and have dodgy classes added to the html by "webkit"

    At one point I was getting errors shown in Chrome saying that the headers were wrong but it could see that they were actually images.

    My code is pretty straightforward
        $output = readfile($filetofetch);
            if (isset($dateModified) && !empty($dateModified)) {
            header("Date: " . date("D, j M Y G:i:s ", $dateModified) . 'GMT');
        }
        header("Content-Type: ".$mime);
        header("Expires: " . gmdate("D, j M Y H:i:s", time() + DAY) . " GMT");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: private",false); // required for certain browsers
        header("Pragma: public");
            // HTTP/1.0    header("Content-Transfer-Encoding: binary");
         echo $output;
        exit;
    PHP:
    So, what am I missing?
     
    sarahk, Nov 8, 2011 IP
  2. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #2
    How do you set $mime value?
    Did you try to view headers in firebug or something like it with incorrect images?
     
    AsHinE, Nov 8, 2011 IP
  3. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #3
    One more thing - when I opened this page http://www.findmyrental.co.nz/adlistings/view/117 I could see no images cause they were blocked by adblock. I guess that's because they have "adimages" in url. I suppose that is the reason of strange classes added by your browser.
     
    AsHinE, Nov 8, 2011 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,899
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #4
    Well that's embarrassing!

    I've stopped using FF as my main browser and totally forgot about the adblocker
     
    sarahk, Nov 8, 2011 IP