note 70328 added to function.header

From: Date: Thu, 12 Oct 2006 00:49:37 +0000
Subject: note 70328 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-118432@lists.php.net to get a copy of this message
If you are trying to send image data to a mobile phone from PHP, some models (Motorola RAZOR V3 on Cingular) for whatever reason require the "Last-Modified" header or they will not show the image. <?php ob_start(); // assuming you have image data in $imagedata $length = strlen($imagedata); header('Last-Modified: '.date('r')); header('Accept-Ranges: bytes'); header('Content-Length: '.$length); header('Content-Type: image/jpeg'); print($imagedata); ob_end_flush(); ?> date('r') produces the date with the numeric timezone offset (-0400) versus Apache, which uses timezone names (GMT), but according to the HTTP/1.1 RFC, dates should be formatted by RFC 1123 (RFC 822) which states: "There is a strong trend towards the use of numeric timezone indicators, and implementations SHOULD use numeric timezones instead of timezone names. However, all implementations MUST accept either notation." (http://www.ietf.org/rfc/rfc1123.txt) ---- Server IP: 216.194.113.175 Probable Submitter: 24.11.116.161 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/70328 Del: integrated -- https://master.php.net/note/delete/70328/integrated Del: useless -- https://master.php.net/note/delete/70328/useless Del: bad code -- https://master.php.net/note/delete/70328/bad+code Del: spam -- https://master.php.net/note/delete/70328/spam Del: non-english -- https://master.php.net/note/delete/70328/non-english Del: in docs -- https://master.php.net/note/delete/70328/in+docs Del: other reasons-- https://master.php.net/note/delete/70328 Reject -- https://master.php.net/note/reject/70328 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#118432) next »