Jump to content

View Images Code Help


izzytees

Recommended Posts

For anyone out there that can solve this, I appreciate it well in advance.  I'm sure it must be something simple, but it has got my head spinning.  I also emailed the author of this code and posted this message on phpbuilder but have yet to hear back so I thought I'd expand my reach to users of this forum.

 

Here is how I'm calling the image page:

<img src="view_image.php?cattype=<?php echo $row_viewimages['cat_type']; ?>&id=<?php echo $row_viewimages['display_id']; ?>"  width="110" height="110" border="0" alt="catalog"/>

 

 

Here are sample issues:

http://www.izzytees.com/viewcatalog.php

http://www.izzytees.com

 

Here is the view_image.php code:

<?php

 

// getdata.php3 - by Florian Dittmer <dittmer@gmx.net>

// Example php script to demonstrate the direct passing of binary data

// to the user. More infos at http://www.phpbuilder.com

// Syntax: getdata.php3?id=<id>

 

 

if($id) {

 

        $cat = $_REQUEST['cattype'];

        $id = $_REQUEST['id'];

 

 

    // you may have to modify login information for your database server:

    @MYSQL_CONNECT("xxx","xxx","xxx");

    mysql_select_db("xxx");

 

 

    $query = "select bin_data,filetype,display_id,cat_type from image_display where display_id='$id' AND cat_type='$cat'";

    $result = @MYSQL_QUERY($query);

 

 

    $data = @MYSQL_RESULT($result,0,"bin_data");

    $type = @MYSQL_RESULT($result,0,"filetype");

 

 

    Header( "Content-type: $type");

    echo ($data);

 

 

};

?>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.