我是CI和PHP的新手。幾天前我能夠很好地使用我的註冊腳本,但現在我的腳本不會再發布任何數據。
我的 「register.php」:
class Register extends MY_Controller
{
private $CI;
function __construct()
{
parent::__construct();
$this->CI = & get_instance();
$this->CI->load->helper('form');
}
public function index($renderData="")
{
$this->title = "title";
$this->_render('pages/register',$renderData);
}
function verify()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'required|max_length[40]');
$this->form_validation->set_rules('password', 'Password', 'required|max_length[40]');
if ($this->form_validation->run() == FALSE)
{
}
else
{
$username = $this->input->post('username');
$password = $this->input->post('password');
redirect('home','refresh');
}
}
}
我的 「頁/ register.php」:
<body style="background-color: #F7F7F6">
<section>
<div class="container register">
<div class="row">
<div class="center span4 well">
<legend> Create an account</legend>
<form method="POST" accept-charset="UTF-8" action="<?php echo base_url('register/verify');?>">
<input type="text" id="username" class="span4" name="username" placeholder="Your Username"/>
<input type="password" id="password" class="span4" name="password"placeholder="Your Password" />
<p></p>
<button type="submit" name="submit" class="btn btn-primary btn-block">Sign Up</button>
</form>
</div>
</div>
</div>
</section>
<hr style="BORDER-RIGHT: medium none; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; HEIGHT: 1px">
</body>
因此,沒有任何人有任何線索,爲什麼它是沒有發佈註冊信息?我記得重新啓動XAMPP,似乎沒有任何工作。
你試圖在哪些方面對調試問題? –
你得到了什麼錯誤? – user2936213
我沒有收到錯誤。 CI只是不發佈數據。 – jsmos