PHP WoL ($device) - by PRThomasUK \n";
//generate refresh header for frame2.
if ( $frame == 2 && $status == 0 ) {
$content .= "\n";
}
return $content;
}
// function htmlheader( ) - Returns HTML content for mainpage, frame1 & frame2 based on value of $frame.
function htmlcontent( )
{
global $pageurl, $device, $deviceip, $deviceport, $devicemac1, $devicemac2, $frame, $tries, $maxtries, $status;
if ( $frame == 2 ) {
if ( $status == 0 ) {
$content = "
$tries/$maxtries attempts to connect to $deviceip:$deviceport completed.
\n";
} elseif ( $status == 1 ) {
$content = "\n";
$content .= "SUCCESS!!!
\n";
$content .= "\n";
$content .= "Connection made to $device ($deviceip:$deviceport).
\n";
} else {
$content = "\n";
$content .= "FAILED...
\n";
$content .= "\n";
$content .= "Unable to connect to $device ($deviceip:$deviceport).
\n";
}
} elseif ( $frame == 1 ) {
$content = "\n";
$content .= "PHP WoL ($device)
\n";
$content .= "\n";
$content .= wakeonlan( $device, $devicemac1 );
if ( $devicemac2 ) {
$content .= "
\n";
$content .= wakeonlan( $device, $devicemac2 );
}
} else {
$content = "\n";
}
return $content;
}
?>