开发者

How to limit a PHP script so that it only works if it GETs an image from the local server?

开发者 https://www.devze.com 2023-03-29 01:05 出处:网络
I have a dynamic resizing image script that gets the location of the image to 开发者_开发知识库be resized-on-the-fly from a GET variable.

I have a dynamic resizing image script that gets the location of the image to 开发者_开发知识库be resized-on-the-fly from a GET variable.

How can I limit the script so that it ONLY works if a local image is passed?

Thanks!


Check if the file exists on your hard disk:

if (file_exists($myImageDir . '/' . $_GET["image_url"])) processImage();

Don't forget to cleanup any GET or POST vars before using in your code.

0

精彩评论

暂无评论...
验证码 换一张
取 消