0
所以我的计划是不是添加样式到每个图像或不同尺寸制作不同的图像,我做了这个脚本:PHP脚本图像
/*FILENAME image.php*/
if(isset($_GET['size'])){
$image['size'] = $_GET['size'];
$size = explode('x', $image['size']);
$image['width'] = $size[0];
$image['height'] = $size[1];
} else {
$image['size'] = null;
}
echo "<img src='images/".$image['name'].".jpeg' style='width:".$image['width']."; height:".$image['height'].";'>";
但它不工作,在我的脚本之一,我有这个:
echo '<img id="img_01" src="image.php?name='.$row2['name'].'&size=150x160" data-zoom-image="image.php?name='.$row2['name'].'&size=150x160"/>';
而浏览器回声只是一个缺失的图像。我怎么能让我的脚本工作?我知道必须有一种方式,因为我记得使用开源代码来做这样的事情。
谢谢您的帮助 –