-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.php
41 lines (38 loc) · 951 Bytes
/
test.php
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
<!--
<img src = "naruto.jpg"/>
-->
<link rel="stylesheet" type="text/css" href="images_css.css">
<link rel="stylesheet" type="text/css" href="includes/css/second.css">
<link rel="stylesheet" type="text/css" href="images/cards.css">
<!-- Put logo here -->
<form action="test.php" method="get">
<center>
<input type = "text" name="search_keyword" value = <?php echo $_GET['search_keyword']; ?> />
<input type = "submit" value="Submit" />
</center>
</form>
<?php
$q = $_GET['search_keyword'];
$q = explode(" ", $q);
echo "Result for " . $q[0] . "<br/>";
$path = "images/" . $q[0];
?>
<div id="wrapper">
<div id="columns">
<?php
if( $opendir = opendir($path)){
while( ($file = readdir($opendir)) !== FALSE ){
if( $file == '.' || $file == "..") continue;
?>
<div class="pin">
<?php $pp = $path . "/" . $file?>
<?php echo "<img src=\"$pp\"/>"; ?>
</div>
<?php
}
}
?>
</div>
</div>
<?php
?>