-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
159 lines (133 loc) · 3.99 KB
/
index.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
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
159
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="questions"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name ORDER BY reply DESC LIMIT 0,10";
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> Forum | Bhumik</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="shortcut icon" href="favicon.gif">
<style type="text/css">
body .cont {margin:20px;}
.navbar .navbar-inner {
padding: 0;
}
.navbar .nav {
margin: 0;
display: table;
width: 100%;
}
.navbar .nav li {
display: table-cell;
float: none;
}
.navbar .nav li a {
font-weight: bold;
text-align: center;
border-left: 1px solid rgba(255,255,255,.75);
border-right: 1px solid rgba(0,0,0,.1);
}
.navbar .nav li:first-child a {
border-left: 0;
border-radius: 3px 0 0 3px;
}
.navbar .nav li:last-child a {
border-right: 0;
border-radius: 0 3px 3px 0;
}
</style>
</head>
<body style="background-image:url(4.png)">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-latest.js"></script>
<h2 style="margin-left:10px;" > Discussion forum </h2>
<div class="cont">
<div class="navbar">
<div class="navbar-inner">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="topics.php">Topics</a></li>
<li><a href="contact.php">Contact </a></li>
<li><a href="about.php">About Us</a></li>
</ul>
</div>
<ul class="breadcrumb">
<li><a href="#" class="active">Home</a> <span class="divider">/</span></li>
</ul>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<ul class="nav nav-list well">
<li class="nav-header">Topics</li>
<li ><a href="#">Home</a></li>
<li><a href="#">turbo c</a></li>
<li><a href="#">java</a></li>
<li><a href="#">facebook</a></li>
<li><a href="#">sqala</a></li>
<li class="divider"></li>
<li><a href="#">javascript</a></li>
<li class="active"><a href="#">jQuery</a></li>
</ul><br>
<div class="well" style="height:55px;margin-bottom:0px;">
<p > Advertise Here<p>
</div>
</div>
<div class="span10">
<table class="table table-hover">
<thead>
<tr>
<th style="width:4%">#</th>
<th style="width:43%">Questions</th>
<th style="width:20%">Topics</th>
<th style="width:9%">Views</th>
<th style="width:9%">Replies</th>
<th style="width:15%">Date</th>
</tr>
</thead>
<tbody>
<?php
$nr=1;
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td><? echo $nr ?></td>
<td><a href="answer.php?id=<? echo $rows['id']; ?>"><? echo $rows['detail']; ?></a></td>
<td><? echo $rows['topic']; ?></td>
<td><? echo $rows['view']; ?></td>
<td><? echo $rows['reply']; ?></td>
<td><? echo $rows['datetime']; ?></td>
</tr>
<?php
$nr++;
}
mysql_close();
?>
</tbody>
</table>
</div>
</div>
</div>
<div style="margin:20px;" >
<hr>
<p class="pull-right"><a href="#">BHUMIK</a></p>
<p>© 2013 Copyrights, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a></p>
</div>
</body>
</html>