Files
system0-2.0/sys0-code/app/webcam.php
2024-06-18 09:36:11 +01:00

27 lines
623 B
PHP

<!DOCTYPE html>
<html>
<?php
$username=htmlspecialchars($_GET["username"]);
$printer_url=$_GET["url"];
$rotation=$_GET["rotation"];
?>
<head>
<title>Webcam</title>
</head>
<body>
<?php
$path = "/var/www/html/user_files/$username/$printer_url.jpeg";
unlink($path);
exec("wget --quiet \"http://$printer_url/webcam/?action=snapshot\" -O $path");
echo("<img style='transform: rotate(".$rotation."deg);' loading='lazy' width='100%' src='/user_files/$username/$printer_url.jpeg'>");
?>
<script>
setInterval(function() {
location.reload();
}, 5000);
</script>
</body>
</html>