我試圖從您輸入的表單中獲取信息。在ID爲ID的地方,它從您輸入ID的信息中獲取信息。這裏的形式& Mysql的$排部..
<input type="text" class="DeathForms" name="userid" maxlength="4" /><br />
$result = mysql_query("SELECT name FROM users WHERE id='".$_POST['userid']."'")
or die(mysql_error());
while($row = mysql_fetch_array($result)) {
}
現在,我試圖讓部分是,它顯示從$ _ POST行[「用戶id」]。是否有可能這樣做?這是我目前有..
<?php
if (isset ($_POST['userid']))
{
file_put_contents('deathlist_' . $id . '.txt', "\n" . '
<table width="800" align="center" class="DeathTable">
<tr>
<td width="200" align="center" class="DeathName"><a class="DeathName" href="user?id=' . $_POST['userid'] .'">' . $row['name'] . '</a></td>
<td width="200" align="center" class="DeathLevel">' . $_POST['threat'] . '</td>
</tr>
</table><br />' . file_get_contents ('deathlist_' . $id . '.txt'));
}
?>
<?php
if (file_exists ('deathlist_' . $id . '.txt'))
{
echo file_get_contents('deathlist_' . $id . '.txt') . '</span>';
}
?>
是否有可能從$ _POST ['userid']的ID獲取數據庫?
好吧,它將它插入到文本文件中,然後用file_get_contents將其回顯出來。 – user1893203