Such as the title: My website also collects articles. How do I implement such a picture format?
To put it simply, how to save the collected pictures? What is the logic of image.php displayed on the front end?
Maybe my expression is not clear enough. What I want is that the server already has pictures, but on the front end I also want to display pictures in the form of image.php?url=xxxxxxx, so I want to ask what the logic of this image.php is. ?
Such as the title: My website also collects articles. How do I implement such a picture format?
To put it simply, how to save the collected pictures? What is the logic of image.php displayed on the front end?
Maybe my expression is not clear enough. What I want is that the server already has pictures, but on the front end I also want to display pictures in the form of image.php?url=xxxxxxx, so I want to ask what the logic of this image.php is. ?
First, each picture needs its own id, such as hajhdjs
Then url?id=hajhdjs
The background gets the corresponding picture based on the id, and then uses the
imagepng() function to output the picture
It’s equivalent to dynamically outputting the picture, and the following series of parameters locate the position of the picture.
Many ideas:
Directly use nginx to intercept and redirect parameters to other urls
php gets the local path image based on the parameters and outputs
1. The backend outputs the image file according to the parameters
2. Set the response header Content-Type: image/png
PHP Set MIME Types and you can echo
output the image content.
The server (php) receives the parameters, gets the characters related to the real link of the picture, and finally splices out the complete link url, and then echo file_get_contents(url)