How do I get the actual return address of an img image?

<img class="lazy" src="http://tu.hanximeng.com/api.php" data-original="http://tu.hanximeng.com/api.php" style="border-radius: 10px; display: inline;" width="100%">

for example, src is a php request interface, so the actual image address returned by img cannot be obtained. How can I get the real img address?

May.14,2021

since it is in the src attribute of the img tag, it must be an image, otherwise it will not be displayed, so the actual address you want is this address. As to whether the php has done anything on the server side (such as taking a picture from another location, or taking the binary content from the database and converting it back to the foreground), it is opaque to the foreground. The front end does not know these operations, let alone the storage address of the server-side picture file.


give you an idea
1. After getting the address, load the picture and then header the header to output the picture
2. Get the address through the api interface before loading img

   

and the browser automatically initiates another request for the 302 status code to request the url defined in the location field of the response header

therefore, if you put aside the browser environment to request this interface, you can directly get the location value in the response header. For example, if you use node, php and other back-end languages to make a http request to this interface, you can directly get the real address of the image, because by default they will not force redirection directly like browsers.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea4833-1cdf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea4833-1cdf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?