Curl: Why is the same code successful? if the code is unsuccessful, the image can be displayed.
Code 2: unable to display images
Reply to discussion (solution)
Code 2 url inaccessible
Http://www.1769pt.com/include/getcode.php is a public url and should naturally be accessible
Http: // 172.16.28.1/root/ef30d3ea-e0c5-448e-8678-c30daccadd20/USER_CACHE/54/66/546686fc-152a-449a-8ae1-7bec1d438fc6/3.jpg is a LAN url, it is hard to say if you can access it
Direct access to the url in Code 2 fails.
$ Error = curl_error ($ ch );
Echo $ error;
Check for any errors.
I have modified the image address of Code 2 and cannot display it.
Access directly.
Solved the problem. I tested it on an online website and prompted "HTTP Status 400-HTTP method POST is not supported by this URL"
Then I will comment out // curl_setopt ($ ch, CURLOPT_POST, 1); thank you!