图片网页
<!DOCTYPE html><html>
<head>
<meta charset="UTF-8">
<title>批量上传并转换图片</title>
</head>
<body>
<form method="post" action="upload.php" enctype="multipart/form-data">
<label for="images">请选择要上传的图片:</label>
<input type="file" name="images[]" id="images" multiple>
<input type="submit" value="上传">
</form>
<?php if(isset($base64_images)): ?>
<form method="post" action="upload.php">
<label for="format">请选择要转换的格式:</label>
<select name="format" id="format">
<option value="jpeg">JPEG</option>
<option value="png">PNG</option>
</select>
<?php foreach($base64_images as $base64_image): ?>
<input type="hidden" name="images[]" value="<?php echo $base64_image; ?>">
<?php endforeach; ?>
<input type="submit" name="convert" value="转换">
</form>
<?php endif; ?>
<?php if(isset($images)): ?>
<form method="post" action="upload.php">
<?php foreach($images as $image): ?>
<input type="hidden" name="images[]" value="<?php echo $image; ?>">
<?php endforeach; ?>
<input type="submit" name="save" value="保存到数据库">
</form>
<form method="post" action="upload.php">
<input type="submit" name="delete" value="删除24小时前的数据">
</form>
<?php foreach($images as $image): ?>
<a href="<?php echo $image; ?>" download><?php echo $image; ?></a><br>
<?php endforeach; ?>
<?php endif; ?>
</body>
</html>
页:
[1]