-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode1.php
More file actions
89 lines (85 loc) · 1.62 KB
/
Copy pathcode1.php
File metadata and controls
89 lines (85 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<html>
<head>
<title>Displaying.. </title>
</head>
<style type="text/css">
body{
background: #E6E6FA;
}
h2{
color: red;
}
h5{
border:5px solid black;
margin:relative;
}
#left{
margin-left:85px;
padding-left: 80px;
float: left;
}
#right{
float:right;
margin-left:170px;
padding-right: 165px;
}
</style>
<body>
<h1><a href="code2.php"><center>Search Again!</a></h1>
<?php
if(isset($_POST['thr']))
{
// echo "You have searched for: ",$_POST['thr'];
$word=$_POST['thr'];
$ans=exec("sudo /var/www/code/a.out $word",$ret);
echo "<br><br>";
$pic=$ret[0];
echo "<br>";
if($pic!="error- openCV Exception")
{
//echo "<img src='data/templates/$pic.jpeg' alt='error' height='200' width='300' />";
$dir = "data/train_images/$pic/";
$file_display = array('jpeg','jpg','png');
if (file_exists($dir) == false)
{
echo 'Directory \'', $dir, '\' not found!';
}
else
{
$dir_contents = scandir($dir);
foreach ($dir_contents as $file)
{
$file_type = strtolower(end(explode('.', $file)));
}
}
$item=array();
foreach(glob("$dir*.*") as $filename)
{
$item[]=$filename;
}
$arrlength=count($item);
echo "<h2><center><strong><u>You have searched for:</u></strong></h2>";
for($x=0;$x<$arrlength;$x++)
{
$side="right";
if($x%2==0)
{
$side="left";
}
?>
<div id="<?php echo $side;?>">
<?
echo "<h5><img src='$item[$x]' alt='Image Not Displayed' height='200' width='300'></h5>"; ?>
<br>
</div>
<? }
}
else
echo "NO SEARCH RESULTS!";
echo "<br><br><br>";
}
echo "<br><br><br>";
?>
<br>
</body>
</html>