📄 browse.php
字号:
<?php
// 包含数据库连接文件和头文件
require ('dbconnect.php');
include('head.php');
?>
<?
// 构造读取数据的sql语句
$titlesql="select * from title";
$titleresult=mysql_query($titlesql,$conn);
// 显示投票主题
?>
<table width="100%" border="1" cellspacing="1" cellpadding="3">
<tr>
<th colspan="4">查看投票主题</th>
</tr>
<tr>
<th width="14%">发起人</th>
<th width="28%">主题</th>
<th width="14%">单选/多选</th>
<th width="44%">投票选项</th>
</tr>
<?
while($title=mysql_fetch_array($titleresult)){
echo "<tr> ";
echo "<td width='14%' align=center>$title[username]</td>";
echo "<td width='32%' align=center><a href='vote.php?id=$title[id]'>$title[title]</a></td>";
if ($title[types]==1){
echo "<td width='14%' align=center>单选</td>";
}
else{
echo "<td width='10%' align=center>多选</td>";
}
echo "<td width='44%'>$title[choice]</td>";
echo "</tr>";
}
echo "</table>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -