2016-02-22 39 views
2

我正在使用Adobe Dreamweaver製作一個使用php和html的網站,並由'000webhost.com'免費託管。所以在我的一個頁面中,特別是我的「inventory_list.php」頁面中,我有一個包含輸入字段的表格。Html將無法在互聯網上正確加載,但在Dreamweaver上沒問題

它看起來像這樣在Dreamweaver中: enter image description here

但是,當我打開它在互聯網上,它看起來像這樣: enter image description here

在放大: enter image description here

它不顯示錶格的其餘部分以及頁面的其餘部分。

這裏是我的inventory_list.php:

<!doctype html> 
 
    <html> 
 
<head> 
 
<meta charset="utf-8"> 
 
<title>Inventory List</title> 
 
<link rel="stylesheet" href="../style/style.css" type="text/css" media="screen" /> 
 
</head> 
 

 
<body> 
 
<div align="center" id="mainWrapper"> 
 
<?php include_once("../template_header.php");?> 
 
<div id="pageContent"><br/> 
 

 
    <div align = "right" style="margin-right:32px;"><a href="#inventory_list.php#inventoryForm">+ Add New T-Shirt</a></div> 
 
<div align="left"style="margin-left:24px"> 
 
    <h2>Inventory List</h2> 
 
    <?php echo $product_list; ?> 
 
    <p></p> 
 
</div> 
 
<a name="inventorForm" id="inventoryForm"></a> 
 
<h3>Add New Inventory Form</h3> 
 

 

 
<form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post"> 
 
<table width="646" border="1"> 
 
    <tbody> 
 
    <tr> 
 
     <td width="131">Product Name &nbsp;</td> 
 
     <td width="339"><label><input name="product_name" type="text" id="prdouct_name" size="60"/>&nbsp;</label></td> 
 
    </tr> 
 
    <tr> 
 
     <td>Product Price &nbsp;</td> 
 
     <td><label>Php&nbsp;<input name="productPrice" type="text" id="productPrice" size="20"/>&nbsp;</label></td> 
 
    </tr> 
 
    <tr> 
 
     <td>Category &nbsp;</td> 
 
     <td><label><select name="category" id="category"> 
 
     \t \t \t <option value=""></option> 
 
       <option value="NBA">NBA</option> 
 
       <option value="PBA">PBA</option> 
 
       </select></label></td> 
 
    </tr> 
 
    <tr> 
 
     <td>Size</td> 
 
     <td><label><select name="size" id="size"> 
 
     \t \t \t <option value=""></option> 
 
       <option value="small">S</option> 
 
       <option value="medium">M</option> 
 
       <option value="large">L</option> 
 
       </select></label></td> 
 
    </tr> 
 
    <tr> 
 
     <td>Product Details&nbsp;</td> 
 
     <td><label><textarea name="productDetails" type="textarea" id="productDetails" cols="64" rows="5"/></label></td> 
 
    </tr> 
 
    <tr> 
 
     <td>Product Image&nbsp;</td> 
 
     <td><label><input type="file" name = "fileField" id="fileField" />&nbsp;</label></td> 
 
    </tr> 
 
    <tr> 
 
     <td>&nbsp;</td> 
 
     <td><label><input type="submit" name="button" id="button" value="Add this item now"/></label></td> 
 
    </tr> 
 
    
 
    </tbody> 
 
</table> 
 
</form> 
 

 

 
<br /> 
 
<br /> 
 
<br /> 
 

 
    </div> 
 

 
    
 
<div> 
 
    
 

 
</div> 
 

 
</div> 
 
</body> 
 
</html>

它不textarea的後顯示雖然它可以正確地顯示在Dreamweaver中。對不起,我不得不在這裏提出類似的問題,但我們的進展報告將在明天發佈,我需要繼續進行編碼。所有幫助非常感謝:)

回答

1

您還沒有正確關閉<textarea>。你有它的自閉(<textarea />),而不是</textarea>

下面你修改的代碼,用live fiddle here

<!doctype html> 
    <html> 
<head> 
<meta charset="utf-8"> 
<title>Inventory List</title> 
<link rel="stylesheet" href="../style/style.css" type="text/css" media="screen" /> 
</head> 

<body> 
<div align="center" id="mainWrapper"> 
<?php include_once("../template_header.php");?> 
<div id="pageContent"><br/> 
<div align="center" id="mainWrapper"> 
<?php include_once("../template_header.php");?> 
<div id="pageContent"><br/> 

    <div align = "right" style="margin-right:32px;"><a href="#inventory_list.php#inventoryForm">+ Add New T-Shirt</a></div> 
<div align="left"style="margin-left:24px"> 
    <h2>Inventory List</h2> 
    <?php echo $product_list; ?> 
    <p></p> 
</div> 
<a name="inventorForm" id="inventoryForm"></a> 
<h3>Add New Inventory Form</h3> 


<form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post"> 
<table width="646" border="1"> 
    <tbody> 
    <tr> 
     <td width="131">Product Name &nbsp;</td> 
     <td width="339"><label><input name="product_name" type="text" id="prdouct_name" size="60"/>&nbsp;</label></td> 
    </tr> 
    <tr> 
     <td>Product Price &nbsp;</td> 
     <td><label>Php&nbsp;<input name="productPrice" type="text" id="productPrice" size="20"/>&nbsp;</label></td> 
    </tr> 
    <tr> 
     <td>Category &nbsp;</td> 
     <td><label><select name="category" id="category"> 
       <option value=""></option> 
       <option value="NBA">NBA</option> 
       <option value="PBA">PBA</option> 
       </select></label></td> 
    </tr> 
    <tr> 
     <td>Size</td> 
     <td><label><select name="size" id="size"> 
       <option value=""></option> 
       <option value="small">S</option> 
       <option value="medium">M</option> 
       <option value="large">L</option> 
       </select></label></td> 
    </tr> 
    <tr> 
     <td>Product Details&nbsp;</td> 
     <td><label><textarea name="productDetails" type="textarea" id="productDetails" cols="64" rows="5"></textarea></label></td> 
    </tr> 
    <tr> 
     <td>Product Image&nbsp;</td> 
     <td><label><input type="file" name = "fileField" id="fileField" />&nbsp;</label></td> 
    </tr> 
    <tr> 
     <td>&nbsp;</td> 
     <td><label><input type="submit" name="button" id="button" value="Add this item now"/></label></td> 
    </tr> 

    </tbody> 
</table> 
</form> 


<br /> 
<br /> 
<br /> 

    </div> 


<div> 


</div> 

</div> 
</body> 
</html> 
+0

謝謝!對不起,在這裏在stackoverflow這個小問題。我沒有太多的HTML,這是我第一次編碼PHP。無論如何,非常感謝你! :) – Andre

相關問題