I'm attempting to write a script that will show images, but also do some database work. If i omit the 'require_once' to connect to the database it works fine, but when I have that in there it gives me an error. How can I connect to the database and still have the images show?
Thanks for your help,
<?php
require_once('../../mysql_connect_pictures.php');
// The file
$filename = 'league.jpg';
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
imagejpeg($image_p, null, 100);
?>
Warning: Cannot modify header information - headers already sent by (output started at etc...Pictures/picturetest.php on line 10
Thanks for your help,
<?php
require_once('../../mysql_connect_pictures.php');
// The file
$filename = 'league.jpg';
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
imagejpeg($image_p, null, 100);
?>
Warning: Cannot modify header information - headers already sent by (output started at etc...Pictures/picturetest.php on line 10