1. include 'showpicture.php'; 這句去掉
2. <td align="padding:5px;"> <?php Showing::show('$result[photo]');?></td>
改為<td align="padding:5px;"> <img src="showpicture.php?photo=<?php $result[photo]');?>"></td> <!-- 要顯示必須用img標記-->
3.showpicture.php代码改為<?php
class Showing {
function show($a){
$filename = $a; $percent = 0.3; // 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, 50);
}
}
$photo = $_GET['photo']; // 獲取photo 參數
Showing::show($photo);
?>
2. <td align="padding:5px;"> <?php Showing::show('$result[photo]');?></td>
改為<td align="padding:5px;"> <img src="showpicture.php?photo=<?php $result[photo]');?>"></td> <!-- 要顯示必須用img標記-->
3.showpicture.php代码改為<?php
class Showing {
function show($a){
$filename = $a; $percent = 0.3; // 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, 50);
}
}
$photo = $_GET['photo']; // 獲取photo 參數
Showing::show($photo);
?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货