You can use PHP to enable HTTP verification for the image httpauthentication www.vividchanelhandbags.comimages20000665.jpg. Write a function to download the image. Know how to verify the account and password test123789. How can I pass the account password through the function? Experts Help ------ solution ------------------ what is garbled? Use PHP for HTTP authentication
Http://www.vividchanelhandbags.com/images/20000665.jpgcan be opened only after httpverification. Write a function to download the image. Know the verified account and password
How does test 123789 do this. How can I pass the account password through the function? Help
------ Solution --------------------
Is this garbled? Haha
PHP code
$ Url = "http://www.vividchanelhandbags.com/images/20000665.jpg"; $ ch = curl_init ($ url); $ useragent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1 )"; $ header = array ('Accept-Language: zh-cn', 'connection: Keep-Alive ', 'cache-Control: no-cache '); // HEADER information curl_setopt ($ ch, CURLOPT_HTTPHEADER, $ header); // USER_AGENT curl_setopt ($ ch, CURLOPT_USERAGENT, $ useragent); curl_setopt ($ ch, CURLOPT_USERPWD, "test: 123789 "); $ response = curl_exec ($ ch); // you get the binary content of the image. to display the image, you must tell the browser, what is the content format header ("content-type: image/jpg"); echo $ response;
------ Solution --------------------
PHP code