在我的index.php中,我包含頁面的所有部分。我的結構基本上是:PHP搜索表單,試圖在頁面的不同部分顯示結果
<div id="page">
<?php include('/home/content/16/7554016/html/template/head.inc.php'); ?>
<?php include('/home/content/16/7554016/html/template/nav_below.inc.php'); ?>
<div id="left"><?php include('/home/content/16/7554016/html/template/left.inc.php'); ?></div>
<div id="body"><?php include('/home/content/16/7554016/html/template/body.inc.php'); ?></div>
<div id="right"><?php include('/home/content/16/7554016/html/template/right.inc.php'); ?></div>
</div>
<div id="footer"><?php include('/home/content/16/7554016/html/template/footer.inc.php'); ?></div>
我有一個自己的頭提交搜索表單。但是,想要在正文中顯示結果。所以,我把results.inc.php
放在body.inc.php
。但是,這顯然不會與head.inc.php
中的表單建立關聯。我怎樣才能使用所有包含?謝謝。
解釋什麼是「自提交搜索表單」。這是否意味着head.inc.php處理您搜索表單提供的$ _POST? –
results.inc.php處理$ _POST。 results.inc.php包含在我想要結果的body.inc.php中。該表單位於head.inc.php中。通過自我提交,我的意思是在同一頁面顯示結果/ $ _SERVER ['PHP_SELF']; – Graham
你可能想要發佈一些代碼(特別是head.inc.php和body.inc.php)... – JW8