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"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "<FONT COLOR=\"navy\">\n"; $content .= "<H1>PHP WoL ($device)</H1>\n"; $content .= "</FONT>\n"; $content .= wakeonlan( $device, $devicemac1 ); if ( $devicemac2 ) { $content .= "<BR>\n"; $content .= wakeonlan( $device, $devicemac2 ); } $content .= "<BR>\n"; $content .= "<BR>\n"; $content .= "<FONT COLOR=\"red\">\n"; $content .= "<H2>Your browser does not support frames...</H2>\n"; $content .= "</FONT>\n"; $content .= "<H3>Status of $device will not be monitored!</H3>\n"; $content .= "\n"; $content .= "\n"; } return $content; } ?>