adding updated code
This commit is contained in:
26
sys0-code/app/webcam.php
Normal file
26
sys0-code/app/webcam.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user