Patrick Troust Patrick Troust - 1 year ago 121
PHP Question

Redirect to another page if stream is offline (PHP)

$fp = fsockopen("", 8000, $errno, $errstr, 1); //last param is timeout in seconds
if (!$fp) {
} else {
fclose($fp); // radio OK

The code is not working and do not redirect.

Answer Source
ob_end_clean(); //erase output
header('Location: ');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download