Jump to content

[SOLVED] Check for a 404 error?


papaface

Recommended Posts

I have this:

<?php
$url = "http://video.stage6.com/1957687/.divx";

$valid = fsockopen("$url", 80, $errno, $errstr, 30);

if	($valid)
echo "active";
else
echo "dead";
?>

I'm trying to test whether or not a link is still active or not.

The code above doesn't work because that link forces a download.

A unactive link shows a 404 error on the page.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.