DispImg.pl
上传用户:qdrechuli
上传日期:2022-08-01
资源大小:917k
文件大小:1k
- #!/usr/bin/perl -w
- use strict;
- use DBI;
- use CGI;
- sub main
- {
- my $h = new CGI;
- my $CamID = $h->param('VL_Cam');
- my $Date = $h->param('VL_Date');
- my $Cur = $h->param('VL_Cur');
- my $db = DBI->connect("DBI:mysql:netcam","root","");
- my $sqlreq = "SELECT R_Img FROM record WHERE ";
- $sqlreq .= "R_Cam=".$CamID." ";
- $sqlreq .= "AND R_Day like '".substr($Date,0,8)."' ";
- $sqlreq .= "AND R_Hour =".substr($Date,8,2)." ";
- $sqlreq .= "AND R_Index =".$Cur." ";
- my $sql = $db->prepare($sqlreq);
- $sql->execute();
- (my $Img) = $sql->fetchrow();
- $sql->finish();
-
-
- $db->disconnect();
-
-
- print "Content-Type: image/jpegn";
- print "Content-Length: " . length($Img) . "n";
- print "Pragma: no-cachen";
- print "n";
- print $Img;
-
- }
-
- main();
- exit(0);