-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaProg.php
More file actions
158 lines (129 loc) · 3.54 KB
/
JavaProg.php
File metadata and controls
158 lines (129 loc) · 3.54 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<html>
<head>
<title>Java Programming</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="style.css">
<style>
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.pic {
border: 5px solid #fff;
float: left;
height: 300px;
width: 300px;
margin: 5px;
overflow: hidden;
-webkit-box-shadow: 10px 10px 10px #f778a1;
box-shadow: 10px 10px 10px #f778a1;
}
.pic1 {
border: 5px solid #fff;
float: left;
height: 300px;
width: 300px;
margin: 5px;
overflow: hidden;
}
.morph {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.morph:hover{
border:70px solid #f778a1;
border-radius:50%;
}
h2{
color: purple;
}
</style>
<style>
div{
color: purple;
}
h1{
color:white;
}
</style>
</head>
<body>
<center><h1>Java Programming Toll</h1></center> <br>
<div class="container">
<section class="register">
<center><h2>Selected Question.....</h2></center>
<a href="mainpage1.php">HOME</a>
<br><br>
<table border="1" cellspacing="10" cellpadding="10">
<th>Question</th>
<th>Author</th>
<th>Date</th>
<th>Time</th>
<?php
$qid=$_GET["qid"];
session_start();
$_SESSION['qid']=$qid;
mysql_connect("localhost", "","") or die("No connection");
mysql_select_db("test") or die ("DATABASE not availabel");
$sql="select question,datee,timee,username from questions where qid =$qid";
$res= mysql_query($sql);
while($row=mysql_fetch_array($res))
{
echo "<tr>";
echo"<td>".$row['question']."</td><td>".$row['username']."</td><td>".$row['datee']."</td><td>".$row['timee']."</td>";
echo "</tr>";
}
?>
</table>
</section>
</div>
<div class="container">
<section class="register">
<center><h2>Answers So Far.....</h2></center>
<a href="mainpage1.php">HOME</a>
<br><br>
<?php
// $qid=$_GET["qid"];
mysql_connect("localhost", "","") or die("No connection");
mysql_select_db("test") or die ("DATABASE not availabel");
$sql1="select answer,datee,timee,author from answers where qid =$qid";
//$ress1= mysql_query($sql1);
$res1=mysql_query($sql1);
$no= mysql_num_rows($res1);
if($no!=0){
echo "<table border='1' cellspacing='10' cellpadding='10'>";
echo "<th>Answer</th>
<th>Author</th>
<th>Date</th>
<th>Time</th> ";
while($row1=mysql_fetch_array($res1))
{
echo "<tr>";
echo"<td>".$row1['answer']."</td><td>".$row1['author']."</td><td>".$row1['datee']."</td><td>".$row1['timee']."</td>";
echo "</tr>";
}
echo "</table>";
}
else if($no==0)
{
echo "Be the First to answer";
}
?>
<form action="insertanswer.php" method="get">
<center><h2>Post your Answer... </h2>
<div class="head_wrapper">
<textarea name="answer" ></textarea>
</div>
<button name="postans" class="buttonscrolly">Post Answer</button>
</center>
</form>
</section>
</div>
</body>
</html>