Forum Moderators: coopster

Message Too Old, No Replies

php link checker

         

dfender

5:47 am on Apr 30, 2005 (gmt 0)

10+ Year Member



Hi guys,

I want to test if my swf files and jpg files are not broken.
I use the fuction fsockopen but this fuction does not work for a file+extension, just domain. Eg www.url.com is ok, but www.url.com/image.jpg is not! but image.jpg is exists!
There is something to that check the full url of files?
Thanks!

Zipper

7:03 am on Apr 30, 2005 (gmt 0)

10+ Year Member



fsockopen returns a file pointer by initiating the socket connection. you have to use a HTTP GET request in your case to access files at the given host. Look at Example 1 of fsockopen() [php.net].

Stormfx

4:50 pm on Apr 30, 2005 (gmt 0)

10+ Year Member



if you're hosting them locally, you'd use:

file_exists()

if you're hosting them remotely, I believe *nix servers support the ping command.

coopster

12:54 am on May 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, dfender.

Did you try either of these options yet?