Announcement

Collapse
No announcement yet.

Integrate image-bytestreams in PHP site

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Integrate image-bytestreams in PHP site

    Hello,

    the problem is simple: I would like to use some pics in website but I don't get them from the file system. I get them from a mysql-db. The data access is not the problem - it's the integration of the bytesstreams into the PHP website.

    Thanks in advance!

  • #2
    Hi PRyba,

    you can't integrate the image into the website directly. You must use two php-scripts. One for create the HTML-Content of the site and one for output the image.

    htmlcontent.php:
    PHP Code:
    <?php
    ...
      echo 
    "<img src=\"dynimage.php\" alt=\"php generatetd image\" />";
    ...
    ?>
    dynimage.php:
    PHP Code:
    <?php
    header
    ('Content-Type''image/jpeg'); // for a jpeg picture instead
    ...
    print(
    $yourImageBytes);
    ?>
    Hope this can help you.

    Falk
    Wenn du denkst du hast alle Bugs gefunden, dann ist das ein Bug in deiner Denksoftware.

    Quellcode ohne ein Mindestmaß an Formatierung sehe ich mir nicht an! Ich leiste keinen Privatsupport per Mail oder PN!

    Comment

    Working...
    X