Jump to content

jacobs

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jacobs's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. redbullmarky thank you for the help. Problem is now solved. Really appreciate your help [!--quoteo(post=358810:date=Mar 27 2006, 04:03 AM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Mar 27 2006, 04:03 AM) [snapback]358810[/snapback][/div][div class=\'quotemain\'][!--quotec--] youre pretty much doing it right, but remember that this script should only be used by calling it from elsewhere, and should not be embedded into your main scripts. so if the file you have got here is, eg, image.php, then you will need to call it via: [code] <img src='image.php?id=3' /> [/code] if you have this script inside a page that also draws other items, notably Tables, etc, then it will not work as Headers need to be sent BEFORE any other content goes to the browser. change $_POST to $_GET in your file, and call it as i shown you above. [/quote]
  2. Hello, thanks for the reply. Well above the random character, I did not see any error. Once I removed the changes I made the picture will be shown on the screen but in a really simple page format (white background and the picture itself). Do you think I have to encode the image ( I am using longblob type - I am saving the image into mysql database)? Do you have a simple example of how to load data from mysql? thanks in advance
  3. Hello everyone, I been trying to load an image from a mysql database using php. The code that I have works fine but once I change background color of the page or add an html table, the jpg picture won't appear and instead it appear as character like ÿØÿàJFIFHHÿÛC Could it be because of configuration in php.ini? Any suggestion I would really appreciate it. I am using iis for the webserver. I really appreciate your help. Thanks in advance Here are the code that I have session_start(); $id = $_POST['id']; // you may have to modify login information for your database server: @MYSQL_CONNECT("localhost","xxxxx","xxxxx"); @mysql_select_db("wip"); $query = "select content,type from data where fileid = '$id'"; $result = @MYSQL_QUERY($query); $data = @MYSQL_RESULT($result,0,"content"); $type = @MYSQL_RESULT($result,0,"type"); Header( "Content-type: $type"); echo $data; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.