书上的一段原码,看看吧
<?php  $image = $_REQUEST['image'];
  $max_width = $_REQUEST['max_width'];
  $max_height = $_REQUEST['max_height'];  if (!$max_width)
    $max_width = 80;
  if (!$max_height)
    $max_height = 60;  $size = GetImageSize($image);
  $width = $size[0];
  $height = $size[1];  $x_ratio = $max_width / $width;
  $y_ratio = $max_height / $height;  if ( ($width <= $max_width) && ($height <= $max_height) ) {
    $tn_width = $width;
    $tn_height = $height;
  }
  else if (($x_ratio * $height) < $max_height) {
    $tn_height = ceil($x_ratio * $height);
    $tn_width = $max_width;
  }
  else {
    $tn_width = ceil($y_ratio * $width);
    $tn_height = $max_height;
  }  $src = ImageCreateFromJpeg($image);
  $dst = ImageCreate($tn_width,$tn_height);
  ImageCopyResized($dst, $src, 0, 0, 0, 0,
      $tn_width,$tn_height,$width,$height);
  header('Content-type: image/jpeg');
  ImageJpeg($dst, null, -1);
  ImageDestroy($src);
  ImageDestroy($dst);?>

解决方案 »

  1.   

    我认为你可以把上传的页面的路径拿来用做变数的值,然后那个变数可以放在input的field显示出来!
    代码如下:
    <html>
    <body>
    <?
    var x="http://123.html";
    ?>
    <input name="simg" type="text" size="37" value="<?echo x; ?>" disabled>
    </body>
    </html>
      

  2.   

    <html> 
    <body> 
    <? 
    $x="http://123.html"; //这是你要抓到的路径
    ?> 
    <input name="simg" type="text" size="37" value=" <?echo $x; ?>" disabled> //把那个变数$x放这里!
    </body> 
    </html>
    对不起,我把代码写错了!
      

  3.   

    我也不知道你上传页面时,是不是跳过去新的页面,生成新的页面,再用<iframe>来引入那个新的页面?对吗?
      

  4.   

    就是把上传做一个单独的页面然后用<iframe>来引入那个新的页面
    如我要做一个产品系统
    代码如下
    商品名称:<input type="text" name="user" size="10" maxlength="10"> 
    商品图片:<input name="simg" type="text" size="37"><br>
    <iframe style="top:2px" ID="UpFile" src="../inc/Upload.php" frameborder=0 scrolling=no width="100%" height="27"> </iframe> 
    点上传后图片路径在:<input name="simg" type="text" size="37">中显示出来
      

  5.   

    首先<input name="simg" id="simg" type="text" size="37">加一个id
    然后
    ../inc/Upload.php  从这个页面的提交到的php页面里输出js来设置
    如upload.php 提交到upfile.php,则可以在upfile.php中输出如下的jsupfile.php<?php
    $FilePath="";//保存文件路径的代码
    //保存文件的代码并且设置$FilePath变量//保存成功后输出jsecho "<script>parent.document.getElementById('simg').value='{$FilePath}';</script>";
    die();
    ?>
      

  6.   

    我非常赞成12楼的,PHP输出js,使用parent.document.getElementById()就可以操作父页面的对象了。echo "<script>parent.document.getElementById('simg').value='{$FilePath}';</script>";