我正在使用一个脚本来调整图像大小。我似乎遇到了一个错误:
错误:未指定图像
可能是因为脚本中的这段代码(image.php):
if (!isset($_GET['image']))
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: no image was specified';
exit();
}
这是我正在做的(profile.php):
$your_image = $row['Image'];
$path_to_image = $row['PortraitPath'];
$width = 100;
$height = 100;
echo "<img src=\'/image.php/{$your_image}?width={$width}&height={$height}&cropratio=1:1&image={$path_to_img}\' alt=\'Alt text goes here.\' />";
因此,我从 MySQL 表中读取$your_image
和$path_to_image
,然后将其放入img source
. 如上所述,显然,图像未设置,这就是我收到第一个错误的原因。我没有得到的是,图像实际上将如何用我的img src
代码设置?我不是简单地显示实际图像吗?那么如果只是显示图片,图像将如何设置呢?谢谢你。