QMAPP Lab Cam
What is happening right now? ... lot's of top secret stuff, and the camera happens to be broken!
What is happening right now? ... lot's of top secret stuff, and the camera happens to be broken!
//Display the latest webcam image
//define the path as relative
$path = "/home/www/physics/htdocs/research/qmapp/webcam/";
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
//searching for image
$current = 0;
while (false !== ($file = readdir($dir_handle)))
{
$date = substr($file, 15, 4).substr($file, 12, 2).substr($file, 9, 2).substr($file, 20, 2).substr($file, 23, 2).substr($file, 26, 2);
if((int)substr($file, 31, 1)) {
$date = $date.(int)substr($file, 30, 1).(int)substr($file, 31, 1);
} else {
$date = $date."0".(int)substr($file, 30, 1);
}
if(substr($file, 0, 9) == "Captured_") {
if($date > $current) {
$current = $date;
$thisfile = $file;
}
}
}
//closing the directory
closedir($dir_handle);
//display the image
if(!$thisfile) {
echo "Webcam currently not broadcasting.";
} else {
echo "";
}
?>
Click here to watch the timelapse video
//Display a listing of previous webcam images //define the path as relative $path = "/home/www/physics/htdocs/research/qmapp/webcam/"; //using the opendir function $dir_handle = @opendir($path) or die("Unable to open $path"); echo "
Previous webcam images
";
//running the while loop
while (false !== ($file = readdir($dir_handle)))
{
if($file!="." && $file!=".." && $file!="ZoneLogs.txt")
$files[]=$file;
}
sort($files);
for($i=0;$i
\n";
}
//closing the directory
closedir($dir_handle);
echo "