-
Notifications
You must be signed in to change notification settings - Fork 0
/
answer.php
37 lines (37 loc) · 956 Bytes
/
answer.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
<html>
<head>
<?php include("navbar.php"); ?>
<!-- mycss -->
<link rel="stylesheet" type="text/css" href="styles/style_login.css">
<link rel="stylesheet" type="text/css" href="styles/style.css">
<?php
if(isset($_POST['submit'])){
require('set_connection.php');
$conn=connection();
$uname = $_POST['username'];
$answer = $_POST['ans'];
if($uname!=""&&$answer!=""){
$sql="insert into record(ans) values('$answer') where username='$uname'";
$conn->query($sql);
echo "answer posted successfully";
}
}
?>
</head>
<body>
<div class="outer">
<div class="all">
<p> LOGIN HERE </p>
<form action = "answer.php" method ="post">
<input type="username" id="username" name="username"><br><br>
<textarea name="ans" id="textarea" placeholder="Type Your Answer..."></textarea><br>
<button type="submit" name= "submit" >POST ANSWER </button>
</form>
</div>
</div>
<!-- FOOTER -->
<div class="navbar1">
<a href="#">© debrief</a>
</div>
</body>
</html>