timthump如何使用查询字符串url

时间:2013-06-12 06:29:35

标签: php javascript css image

我使用的是timthump.php,使用起来非常方便,但是我们使用它的问题是,我们无法提供标准的图像位置网址。

在我们的情况下,我们将图像保存在数据库中然后我设计了一个php页面,它从查询字符串中读取id或name,然后将图像呈现为响应。在哪里我们需要获取图像,我们使用。

getmemberimg.php?id=1

虽然timthumb语法看起来像这样。

timthumb.php?src=image.jpeg

timthumb.php?src=https://xyzsite.com/image.jpeg

现在我把我的网址写成

timthumb.php?src=getmemberimg.php?id=1
timthumb.php?src=https://mysite.com/getmemberimg.php?id=1

这不起作用并返回错误。

如何克服这个问题?我的问题是如何将我的图像传递给timthumb.php,而我可以使用getmemberimg.php获取图像?id = 1 ...

1 个答案:

答案 0 :(得分:0)

我不知道timthumb.php是什么。但是,如果您想获取网页的输出(例如来自getmemberimg.php?id=X的图片),您可以使用file_get_contentscurl


的file_get_contents:

Show image using file_get_contents

http://php.net/manual/en/function.file-get-contents.php


卷曲:

http://www.bitrepository.com/download-image.html

http://php.net/manual/en/book.curl.php

相关问题