-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstory.php
51 lines (47 loc) · 1.44 KB
/
story.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
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<style type="text/css">
.back{
border-width: 2px;
}
</style>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
<body>
<nav class="navbar navbar-light bg-info justify-content-between p-4">
<img src="../img/title3.PNG" class="pl-md-5" height="40" width="150">
<form class="form-inline pr-md-5">
<a class="navbar-brand nav-link" onclick="home()"><b>home</b></a>
</form>
</nav>
<div class="container p-4">
<div class="row">
<div class="card p-4 col-12 text-dark border border-dark">
<?php
$seldata=$_POST['foo'];
include '../config.php';
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
$agriculture = "SELECT topic,answer,author FROM agriculture where topic = '$seldata'";
$agri = $con->query($agriculture);
if ($agri->num_rows > 0){
while ($row = $agri->fetch_assoc() ) {
echo "<h2><b><center>" . $row["topic"]."</center></b></h2></div>";
echo "<div class='p-3'></div>";
echo "<div class='card border border-dark col-12 p-2'><h4>" . $row["answer"]."</h4></div><br>";
echo "<h5 class='offset-11 pt-2'>- ".$row["author"]."</h6>";
}
}
?>
</div></div></div>
</body>
<script>
function home() {
location.href = '../index.html';
}
</script>
</html>