Display php generated images from database

images php coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Post by gesf » Tue Jul 05, 2005 5:53 am

Code: Select all

<?php

$img_path = $row_phqs['location'] . $row_phqs['file'];
$img = imagecreatefromjpeg($img_path);

?>

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Post by Alexej Kubarev » Wed Jul 06, 2005 12:42 am

the problem is that you have to send those headers before anything else.

There are several ways, one of them would be setting output_buffering to on in php.ini
You may also want to use php internal buffering: ob_start(), ob_end(), ob_get_content(), ob_clean() and so on are prety usefull

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Post by gesf » Wed Jul 06, 2005 4:20 am

Oh! Ok... do what Alexei said :)

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Post by Alexej Kubarev » Wed Jul 06, 2005 4:31 am

hehe gesf ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest