-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
50 lines (46 loc) · 1.02 KB
/
Copy pathindex.php
File metadata and controls
50 lines (46 loc) · 1.02 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
<?php
require "inc/db.php";
//fetch existing shouts
$query = "SELECT * FROM shouts ORDER BY id DESC";
$result = $db_conn->query($query);
if(!$result){
echo "ERROR: ".$db_conn->error;
die();
}
?>
<html>
<head>
<meta charset="UTF-8">
<title>Php Shoutbox</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div class="container">
<header>
<h1>JS Shoutbox</h1>
</header>
<div id="shouts">
<ul>
<?php
while($shout = $result->fetch_object()):
echo "<li>$shout->name : $shout->shout [$shout->date]</li>";
?>
<?php
endwhile;
?>
</ul>
</div>
<footer>
<form action="">
<label for="name">Name</label>
<input type="text" name="name" id="name"/>
<label for="shoutText">Shout Text</label>
<input type="text" name="shoutText" id="shoutText"/>
<input type="submit" name="submit" id="submit" value="SHOUT"/>
</form>
</footer>
</div>
<script src="../dist/jQ/jquery-3.1.0.min.js"></script>
<script src="script.js"></script>
</body>
</html>