-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmyquestion.php
68 lines (61 loc) · 2.89 KB
/
myquestion.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>您提出过的问题</title>
<link rel="stylesheet" type="text/css" href="我提出&回答过的问题.css">
<link rel="stylesheet" type="text/css" href="public.css"><!--外部样式-->
<script type="text/javascript" src="动画.js"></script>
</head>
<body>
<h1>课业难题交流</h1>
<div id="first" onclick=window.open("首页(待登录).html") onmouseover="over(this)" onmouseout="out(this)"></div>
<div id="textOne">
<p>退出登录</p>
</div>
<div id="second" onclick=window.open("提问.html") onmouseover="over(this)" onmouseout="out(this)"></div>
<div id="textTwo">
<p>我要提问</p>
</div>
<div id="three" onclick=window.open("个人中心.html") onmouseover="over(this)" onmouseout="out(this)"></div>
<div id="textThree">
<p>个人中心</p>
</div>
<div id="four" onclick=window.open("shouye(denglu).php") onmouseover="over(this)" onmouseout="out(this)"></div>
<div id="textFour">
<p>我要搜索</p>
</div>
<table style="margin-left: 30px;float: left">
<tr style="text-align: left">
<th width="400px" style="float: left;margin-left: 20px; border:1px solid; border-radius:3px; text-align:center;" >内容:</th>
<th width="100px" style="border:1px solid; border-radius:3px; text-align:center;">提问人:</th>
<th width="100px" style="border:1px solid; border-radius:3px; text-align:center;">回复数目:</th>
<th width="100px" style="border:1px solid; border-radius:3px; text-align:center;">是否解决:</th>
<th width="100px" style="border:1px solid; border-radius:3px; text-align:center;">提问时间:</th>
</tr>
<?php
$con=mysqli_connect("localhost","root","","users");
if (!$con){
die("连接失败:".mysqli_connect_error());
}
session_start();
$id=$_SESSION['G_id'];
$result=mysqli_query($con, "select * from problem where people='$id'");//显示当前用户已提出的所有问题
$number=mysqli_num_rows($result);
for ($x=1;$x<=$number;$x++)
{
$row=mysqli_fetch_array($result);
echo "<tr>";
$text=$row["text_content"];
echo "<td>"."<a href='answer_question.php?content=$text'>".$text."</a>"."</td>";
echo "<td>".$id."</td>";
echo "<td>".$row['reply_num']."</td>";
echo "<td>".$row['state']."</td>";
echo "<td>".$row['time']."</td>";
echo "</tr>";
}
mysqli_close($con);
?>
</table><!--显示出我提出过的问题,可以点击该问题直接进入问题的页面-->
</body>
</html>