php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9666 Can't display image/pjpeg and image/gif in one sanme page
Submitted: 2001-03-10 03:19 UTC Modified: 2001-05-10 11:42 UTC
From: hellmarch at 263 dot net Assigned:
Status: Closed Package: *Graphics related
PHP Version: 4.0.3pl1 OS: Linux
Private report: No CVE-ID: None
 [2001-03-10 03:19 UTC] hellmarch at 263 dot net
I am using php 4.03pl1 version on linux now.I found that bug:i use mysql's BLOB mode to record a gif or jpg binary data stream,when i read them out and display them in one same page,gif or jpg will not display on page at the first time i load the page.Must refresh the page,the two type can be displayed.
I don't know if this is a bug or not,so,thanx a lot.
Attach,my program:

<?
    require("config.inc");
    $db = mysql_connect($db_server,$db_user,$db_pass) or die('Can't connect db server');
    mysql_select_db($db_name) or die('Can't connect to read database');
 
    $sql = "select data,filetype from images where name='$name'";
    $res = mysql_query($sql,$db);

    $data = mysql_result($res,0,"data");
    $type = mysql_result($res,0,"filetype");

    Header( "Content-type: $type");
    echo $data;
mysql_close();
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-10 14:07 UTC] sniper@php.net
Works for me just fine. What is the url to that page of 
yours? 

--Jani

 [2001-03-11 00:04 UTC] hellmarch at 263 dot net
Sorry,this page is not on web,it's on my intranet.I am a Chinese,I am not good at english.I mean one of the two types will not display on the first time that the page load,Must refresh can display togather.
 [2001-03-11 05:35 UTC] mathieu@php.net
If you inserted this with PHP also, did you use addslashes
on the binary data? IIRC that's required, or mysql 'll be kinda messy with the data..

-- Mathieu
 [2001-03-11 20:36 UTC] hellmarch at 263 dot net
Yes,I use addslashes on the binary data.Didn't need to use this function?
 [2001-04-19 09:55 UTC] sniper@php.net
Could you please add script into this report that you use to
ADD the images into the database? And please make it short
one. 

--Jani

 [2001-05-10 05:55 UTC] sniper@php.net
No feedback. If problem exists with PHP 4.0.5, reopen.


 [2001-05-10 10:43 UTC] hellmarch at 263 dot net
$data = addslashes(fread(fopen($image, "r"), filesize($image)));
 [2001-05-10 10:52 UTC] derick@php.net
Please include your whole script AND the images you have problems with.

regards,
Derick
 [2001-05-10 10:54 UTC] sniper@php.net
And is this with PHP 4.0.5 ?


 [2001-05-10 11:32 UTC] hellmarch at 263 dot net
No it's with php4.03
Ok I am using php4.05.Everything is good.Thanks a lot to all of you.Thank you very much.

Best
Regards
 [2001-05-10 11:42 UTC] sniper@php.net
Great that we can help! :)
Closed.

--Jani

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun May 19 12:01:26 2019 UTC