這是當我用html代碼手動編寫表格時發生的事情頁腳停留在頁面的按鈕位置,但是當我用php做到這一點時,頁腳顯示在中間的頁面。下面是我用來打印表格中的PHP代碼:Php代碼干擾html頁腳
<?php
if (isset($_POST["tipi"],$_POST["godina"],$_POST["kati"]))
{
// Create connection
[email protected]_connect("localhost","root","","merville");// duhet ndryshuar emri i databazes dhe pastaj emri i tabeles ne rastin tone merville
// Check connection
if (mysqli_connect_errno()) {
echo "Per momentin faqja eshte duke u punuar. ";
}
else{
//#################################
$tipi=$_POST["tipi"];
$godina=$_POST["godina"];
$kati=$_POST["kati"];
$dhoma=$_POST["dhoma"];
//#################################
//############ berja e querit
$kerkim="SELECT * FROM motorrkerkimi WHERE tipi='$tipi'
AND godina='$godina' And kati='$kati' And dhoma='$dhoma'
ORDER BY vleratotale ASC";
$query1=mysqli_query($con,$kerkim);
//############
echo "<table border='2' class='table-fill' >
<thead>
<tr>
<th>Apartamenti </th>
<th>Dhoma </th>
<th>Kati </th>
<th>Sip. Totale m2 </th>
<th>Cmimi Euro/m2 </th>
<th>Vlera totale Euro </th>
<th>Foto dhe Detaje </th>
</tr>
</thead>
";
echo "<tbody class='table-hover'>";
while($kerkim=mysqli_fetch_array($query1)){
echo "<tr>";
echo "<td>"; echo "".$kerkim[1]; echo "</td>";
echo "<td>"; echo "".$kerkim[6]; echo "</td>";
echo "<td>"; echo "".$kerkim[4]; echo "</td>";
echo "<td>"; echo "".$kerkim[12]; echo "</td>";
echo "<td>"; echo "".$kerkim[10]; echo "</td>";
echo "<td>"; echo "".$kerkim[11]; echo "</td>";
echo "<td>"; echo "<a href='$kerkim[14]' >Shiko</a>"; echo "</td>";
echo "</tr>";
}
echo "</tbody>";
mysqli_close($con);
}// fundi i else-it fillestar i cili ben ekzekutimin e kodit nqs databaza eshte pa probleme.
}else{echo "<h2>Ju lutem plotesoni te dhenat perpara se te klikoni.</h2>";}// fundi i if-it fillestar
?>
這裏是一個圖片來說明我的問題:
的tranpsparent灰色塊是頁腳和它是在頁面的中間它不會停留在底部。如果這樣做只與沒有任何PHP代碼的HTML頁腳留在最後,它不會干擾表。 有人可以給我一個想法我做錯了什麼? Thx
你在哪裏試圖調用這個PHP腳本?我認爲在你寫在HTML中的地方,對吧? – 2014-10-02 21:33:06
PHP代碼的輸出中必定有些東西搞砸了。它包括你不知道的類嗎?所有標籤是否正確關閉? PHP運行時是否包含所有適當的類? – 2014-10-02 21:36:33
缺少''它看起來像。 – 2014-10-02 21:37:04