【发布时间】:2011-11-16 15:28:51
【问题描述】:
所以我使用了this guide 并且能够想出这个:
<html>
<head></head>
<body>
<form action="process.php" method="get">
<input type="text" name="image"/>
<input type="submit"/>
</form>
</body>
</html>
我想出了process.php:
<?php
include("SimpleImage.php");
$imgName = $_GET["image"]; //assuming you used GET request and form submits to http://url/script.php?image=something.jpg
$image = new SimpleImage();
$image->load($imgName);
$image->resizeToWidth(250);
$image->save($imgName);
echo $imgName;
?>
但是有些不对劲。这不是保存图像:(我完全是一个PHP菜鸟,所以我希望你能给一些新手友好的解决方案。谢谢你:)
【问题讨论】:
-
只是在黑暗中拍摄,但如果
$imgName引用远程服务器上的图像,那么$image->save($imgName)不会尝试将其保存到远程服务器? -
当你说它不保存时,它在做什么?您是否收到错误或图像文件只是没有出现?您的 $imgName 中回显了什么?
-
那我该怎么办?加载 process.php 后我只是得到一个空白页