简体   繁体   中英

getimagesize function doesn't return anything

I am using php function getimagesize(). It does work in almost all condition but it doesn't work for a particular url. Please help me why isn't it working for that url. Below you can check that url:

getimagesize('https://marketdataresearch.credit-suisse.com/cs/mdr/p/s/framework10/img/logo_cs.gif');

It returns nothing and not giving any error.

That specific URL actually has some rudimentary security behind it. If you use curl to fetch that URL you will see the following location header:

Location: /cookie-check?trg=insanely-long-strong

When you follow that, you just end up on a regular HTML page. What you're trying to do won't be possible without fetching the cookie, using the cookiejar in a curl request, downloading the file, and running getimagesize against the local file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM