#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    30
    Rep Power
    15
    I am trying to display multiple pictures/text/other html content onto a page. I am pulling the picture binary data right out of a MySQL database and slamming it to the user. I can get 1 picture to display but that is it. I have code if you want see it, but I don't think it will help in this situation. The headers info I have tried to send it either.

    Header ("Content-type: image/gif"); AND
    Header ("Content-type: text/html");

    Please help. I am loooooooosing my mind!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    I know you can only send Header once on a page. You should try including an external file that has a function that prints the image data out in it and then includes it your page, so you are only using one Header per image that you want to use
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    30
    Rep Power
    15
    So you are saying that I should use a
    include("include.php");

    to do all of my processing...and then slam it out to the page? I think I have tried that , but I will give it a shot...Anybody else any any ideas?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    30
    Rep Power
    15
    If anyone cares this is how I finally got it to work. It may not be that pretty, but it worked.

    display.php just pulls the picture out of the database and slams it to the browser per the ID you give it.
    --->display.php<---
    mysql_connect("localhost", "root", "letmein");
    mysql_select_db("devgallery");

    $query = "Select picdata from pictures where(ID=" . $ID . ")";
    $result=@mysql_query($query);

    $data=@mysql_result($result,0,"picdata");
    echo $data;
    ------END display.php<--------

    To call a picture up you could reference in any HTML docuemnt this line

    <img src="http://www.foobar.org/display.php?ID=1">

    or the ID of the picture binary data you want to slam to the browser.

    Full code is avalible for any of my php projects at http://www.geekgetsthegirl.com/projects

Similar Threads

  1. Replies: 2
    Last Post: January 28th, 2004, 08:07 AM
  2. GZIPPING output with out recieving proper headers
    By Webbywarehouse in forum PHP Development
    Replies: 0
    Last Post: January 13th, 2004, 01:57 AM
  3. emulate file via headers
    By glassgorilla in forum PHP Development
    Replies: 0
    Last Post: January 11th, 2004, 05:54 AM
  4. Replies: 2
    Last Post: December 12th, 2003, 06:25 PM
  5. Replies: 6
    Last Post: October 13th, 2003, 08:35 AM

IMN logo majestic logo threadwatch logo seochat tools logo