這是概念。用戶將從文本欄輸入數據。當點擊提交按鈕時,數據將被保存到「VIEW HISTORY」菜單欄。查看歷史記錄是從home.php輸入數據的地方。當我點擊提交按鈕時如何顯示結果? (Like查看歷史記錄)
E.g:
Home.php
(data1)
Enter Name: (I type..)Black Cat
Age: (I type..)21
Job: (I type..)Spy
(data2)
Enter Name: (I type..)Black Dog
Age: (I type..)24
Job: (I type..)Cook
提交按鈕(我點擊它),它說的數據提交給我的數據庫。 後來,當我點擊「查看歷史記錄菜單欄」。該FF將顯示:
DATA1
DATA2
<Click next to view next page.. etc>
當我點擊數據1,從數據1的全名,年齡和工作就會出現。所以是從data2 ..等等.. :)
這是我唯一的問題..我不能顯示這些數據:(請幫助!我有一些代碼在這裏..但我不知道如何解決它:(我希望你能給一些樣品,所以我可以模仿移動,或者如果我們可以幫助更好的解決這個。:(謝謝你們!
<?php
$cfccon = include("E:/xampp/conn1/cfmscsd.php");
//This is about the localhost, username, password stuff
$query="SELECT * FROM contents";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$B1=mysql_result($result,$i,"B1");
$B2=mysql_result($result,$i,"B2");
$B3=mysql_result($result,$i,"B3");
$B4=mysql_result($result,$i,"B4");
$B5=mysql_result($result,$i,"B5");
$B6=mysql_result($result,$i,"B6");
$B7=mysql_result($result,$i,"B7");
$B8=mysql_result($result,$i,"B8");
$B9=mysql_result($result,$i,"B9");
$B10=mysql_result($result,$i,"B10");
$i++;
}
?>
<html>
<tr>
<td bgcolor="#bfb9a7"><span class="style77">CCC</span></td>
<td bgcolor="#CCCCCC"><div align="center" class="style66"><input name="B1" type="text" size="18" id="B1" value="<?php echo $B1;?>" disabled="disabled"/></div></td>
<td bgcolor="#CCCCCC"><div align="center" class="style66"><input name="B2" type="text" size="18" id="B2" value="<?php echo $B2;?>" disabled="disabled"/></div></td>
<td bgcolor="#CCCCCC"><div align="center" class="style66"><input name="B3" type="text" size="18" id="B3" value="<?php echo $B3;?>" disabled="disabled"/></div></td>
<td bgcolor="#CCCCCC"><center><div class="style66"><input type="button" onclick="tbsp1()" value="<?php echo $tbsp1;?>add" disabled="disabled"/></center></td>
<td bgcolor="#FEEDD8"><div align="center" class="style66"><input name="B4" type="text" size="18" id="B4" value="<?php echo $B4;?>" disabled="disabled"/></div></td>
</tr>
<tr>
<td><span class="style77">SCC</span></td>
<td><div align="center" class="style66"><input name="B5" type="text" size="18" id="B5" value="<?php echo $B5;?>" disabled="disabled"/></div></td>
<td><div align="center" class="style66"><input name="B6" type="text" size="18" id="B6" value="<?php echo $B6;?>" disabled="disabled"/></div></td>
<td><div align="center" class="style66"><input name="B7" type="text" size="18" id="B7" value="<?php echo $B7;?>" disabled="disabled"/></div></td>
<td><center><input type="button" onclick="tbsp2()" value="<?php echo $tbsp2;?>add" disabled="disabled"/></center></td>
<td bgcolor="#FEEDD8"><div align="center"><input name="B8" type="text" size="18" id="B8" value="<?php echo $B8;?>" disabled="disabled"/></div></td>
</tr>
<tr>
<td bgcolor="#bfb9a7"><span class="style77">NCC</span></td>
<td bgcolor="#CCCCCC"><div align="center" class="style66"><input name="B9" type="text" size="18" id="B9" value="<?php echo $B9;?>" disabled="disabled"/></div></td>
<td bgcolor="#CCCCCC"><div align="center" class="style66"><input name="B10" type="text" size="18" id="B10" value="<?php echo $B10;?>" disabled="disabled"/></div></td>
</tr>
</html>
感謝Charles對此進行編輯。 ;)我不知道如何呃。 :D – catsgirl008 2011-03-30 01:20:54