作者pttkazu ()
看板PHP
标题[请益] 关於缩图问题
时间Tue Aug 15 20:52:38 2006
写了一个小小的测试
但不知哪里出了问题,现在大致猜想是没接收到值的问题
故想问问大家到底是哪里出了错
以下是程式
//465.php
<?
$name = 1;
?>
<img src="789.php?name=<? echo $name; ?>" border="0">
将$name值传送到789.php
//789.php
<?
$img_type = "GIF";
$photo_path = "456photo/1.gif";
$src_img = imagecreatefromgif($photo_path);
$new_W = imagesx($src_img) * 0.2;
$new_H = imagesy($src_img) * 0.2;
if ( $new_W < 150 ) {
$new_H = ( 150 / $new_W ) * $new_H;
$new_W = 150;
}
$dst_img = imagecreatetruecolor($new_W, $new_H);
imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_W, $new_H, imagesx($src_img), imagesy($src_img));
header("Content-type: image/".$img_type);
if ( $img_type == "JPEG" )
imagejpeg($dst_img);
elseif ( $img_type == "PNG" )
imagepng($dst_img);
else
imagegif($dst_img);
imagedestroy($dst_img);
imagedestroy($src_img);
?>
麻烦各位大大帮我看看到底哪里出了问题
如果可以请帮我讲解一下,谢谢。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.142.108.38
1F:推 gmobug:你的789.php里面似乎没有出现$_GET['name'] or $name 08/16 04:24