我迷路了。我想要做的是,我希望我的网站允许用户在我的数据库中选择某一行(记录),然后将它们重定向到另一个网页,以显示有关该特定记录的完整信息。我不知道我怎么能这两个网页连接在一起使用动态表/文.. 下面是我的代码的一部分:(这是第一个网页:)使用动态文本链接提交表格
mysql_select_db($database_rfq_portal, $rfq_portal);
$query_rfqrecord = "SELECT tblrfq.`RFQ_ID`, tblrfq.`Company_Name`, tblrfq.Service,
tblrfq.`Kind_of_Request`, tblrfq.Status, tblrfq.`Date` FROM tblrfq";
$rfqrecord = mysql_query($query_rfqrecord, $rfq_portal) or die(mysql_error());
$row_rfqrecord = mysql_fetch_assoc($rfqrecord);
$totalRows_rfqrecord = mysql_num_rows($rfqrecord);
<form id="viewform" name="viewform" method="get" action="ViewSpecificRFQ.php">
<table width="716" border="1" align="center" cellpadding="5">
<tr>
<td>RFQ ID</td>
<td>Company Name</td>
<td>Service</td>
<td>Kind of Request</td>
<td>Status</td>
<td>Date</td>
</tr>
<?php do { ?>
<tr>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['RFQ_ID']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Company_Name']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Service']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Kind_of_Request']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Status']; ?></a></td>
<td><a href="ViewSpecificRFQ.phpRFQID=<?php echo $row_rfqrecord['RFQ_ID'];?>"><?php echo $row_rfqrecord['Date']; ?></a></td>
</tr>
<?php } while ($row_rfqrecord = mysql_fetch_assoc($rfqrecord)); ?>
</table>
}
</form>
这是将获取表单的网页..(我的代码部分)
$RFQID = $_GET['RFQ_ID'];
mysql_select_db($database_rfq_portal, $rfq_portal);
$query_rfqrecord = "SELECT * FROM tblrfq WHERE $RFQID";
$rfqrecord = mysql_query($query_rfqrecord, $rfq_portal) or die(mysql_error());
$row_rfqrecord = mysql_fetch_assoc($rfqrecord);
$totalRows_rfqrecord = mysql_num_rows($rfqrecord);
mysql_select_db($database_rfq_portal, $rfq_portal);
$query_user = "SELECT tbluser.Username, tbluser.Password FROM tbluser";
$user = mysql_query($query_user, $rfq_portal) or die(mysql_error());
$row_user = mysql_fetch_assoc($user);
$totalRows_user = mysql_num_rows($user);
<table width="716" border="0" align="center">
<tr>
<th colspan="2" scope="row">RFQ ID:</th>
<td><?php echo $row_rfqrecord['RFQ_ID']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Company Name:</th>
<td width="511"><?php echo $row_rfqrecord['Company_Name']; ?></td>
</tr>
<tr>
<th width="101" rowspan="2" scope="row">Address:</th>
<th width="90" scope="row">Site A:</th>
<td><?php echo $row_rfqrecord['Address_A']; ?></td>
</tr>
<tr>
<th scope="row">Site B:</th>
<td><?php echo $row_rfqrecord['Address_B']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Contact Number:</th>
<td><?php echo $row_rfqrecord['Contact_Number']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Contact Person:</th>
<td><?php echo $row_rfqrecord['Contact_Person']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Service:</th>
<td><?php echo $row_rfqrecord['Service']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Bandwidth:</th>
<td><?php echo $row_rfqrecord['Bandwidth']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Telco:</th>
<td><?php echo $row_rfqrecord['Telco']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Account Manager:</th>
<td><?php echo $row_rfqrecord['Account_Manager']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Status:</th>
<td><?php echo $row_rfqrecord['Status']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Kind of Request:</th>
<td><?php echo $row_rfqrecord['Kind_of_Request']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Date:</th>
<td><?php echo $row_rfqrecord['Date']; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Remarks:</th>
<td><?php echo $row_rfqrecord['Remarks']; ?></td>
</tr>
</table>
</form>
这将用户重定向到下一个页面,但我的问题是,它不断显示相同的记录,WH ich是我数据库中的第一条记录。
在您的表单中,我没有看到任何方式让您的用户选择想要的行,您只有提交按钮,我是否错过了某些内容? – Frhay 2013-02-14 10:39:32
如果你需要选择多个记录放在每个栏中的复选框,并把提交按钮 – Minesh 2013-02-14 10:41:53
@Frhay我在每行旁边添加一个链接,以便如果用户点击它,用户将自动直接到下一个网页。我没有使用提交按钮..(第一页) – 2013-02-14 10:43:33