我有以下控制文件:POST變量空
<?php
class Test extends CI_Controller
{
function __construct()
{
parent::__construct();
}
function index()
{
print_r($_POST);
$view_params = array();
$this->load->view('test', $view_params);
}
}
?>
用的視圖文件:
<form action="/test" method="post">
<input type="text" name="test" />
<input type="submit" />
</form>
<ul id="account">
<li class="separator url"><label>Domain Address (URL)</label><input maxlength="22" type="text" name="sub_url" />
<small class="subtext">This is the link people use to find your site. You can change this at any time.</small>
</li>
</ul>
<img class="green_arrow" src="assets/images/green_arrow.png" />
當我點擊提交按鈕,無後數據被吐了出來,但是當我做了頁面刷新,它說數據已發佈並將重新發送。
此外,我認爲HTML只是一個片段,但請理解我試圖減少代碼,因此減少了問題領域的數量。之後垃圾太多的原因是因爲如果我刪除了視圖文件停止工作,但這是另一個問題。
如果你只是調用父類的構造函數,那麼你不需要你的構造函數 - 這已經爲你完成了。 – 2011-03-05 00:11:48
它打印的是什麼?陣列()?或者什麼也沒有? – 2011-03-05 00:15:47
打印Array()。 – JohnathanKong 2011-03-05 00:21:40