【发布时间】:2013-02-24 10:27:04
【问题描述】:
我想在 PHP 中执行以下操作
我的目录中有图片,我需要使用 "site.com/image.php?pic=xx/xx.jpg" 将图片加载到 php 文件清理页面中
例如:http://freeminecraftaccount.org/image.php?pic=images/minecraft.jpg
if (file_exists('image.html')) {
$temfile = fopen('image.html', 'r');
$template = fread($temfile, filesize('image.html'));
if ($title) {
$template = eregi_replace("<PICTURETITLE>", $title, $template);
} else {
$template = eregi_replace("<PICTURETITLE>", $notitle, $template);
}
if ($desc) {
$template = eregi_replace("<PICTUREDESCRIPTION>", $desc, $template);
}
if ($pic) {
$template = eregi_replace("<PICTURE>", "src=\"$pic\">", $template);
} else {
$template = eregi_replace("<PICTURE>", $noimage, $template);
}
if ($return) {
$template = eregi_replace("<PICTURELINK>", "<a href=\"$return\">RETURN</a>", $template);
} else {
$template = eregi_replace("<PICTURELINK>", "<a href=\"/\">RETURN</a>", $template);
}
echo $template;
}
?>
如果有人能帮忙那就太好了 谢谢!
【问题讨论】:
-
What have you tried?你还需要更多细节。使用
$_GET在 PHP 中加载图像的方法有很多@