gpt4 book ai didi

php - 制作代码点火器注册表

转载 作者:行者123 更新时间:2023-11-29 04:18:03 24 4
gpt4 key购买 nike

<分区>

所以我正在制作一个供人们注册的表格,但它不起作用,并且出于某种原因,我在 netbeans 中的调试器不起作用,所以我无法正确检查。

这是html表单

<?php

if(validation_errors() != false)
{
echo '<div class="form-group alert alert-danger alert-box has-error">';
echo'<ul>';
echo validation_errors('<li class="control-label">', '</li>');
echo'</ul>';
echo '</div>';
}

/* form-horizontal */

echo form_open('main/insertInformation');

?>

<div class="form-group">
<input type="text" name="name" class="form-control input-lg" placeholder="Name">
</div>
<div class="form-group">
<input type="email" name="email" class="form-control input-lg" placeholder="Email">
</div>
<div class="form-group">
<input type="text" name="phone" class="form-control input-lg" placeholder="Phone">
</div>
<div class="form-group">
<input type="password" name="password" class="form-control input-lg" placeholder="Password">
</div>
<div class="form-group">
<input type="password" name="password_confirm" class="form-control input-lg" placeholder="Confirm Password">
</div>
<div class="form-group">
<button type='submit' class="btn btn-primary btn-lg btn-block">Sign In</button>
</div>
</div>

然后我尝试像这样将所有这些信息发送到我的 Controller

public function insertInformation(){
$this->load->helper('form');
$this->load->library('form_validation');

$this->form_validation->set_rules('name', 'Name', 'required');
$this->form_validation->set_rules('email', 'Email', 'required');
$this->form_validation->set_rules('phone', 'Phone', 'required');
$this->form_validation->set_rules('password', 'Password', 'required|min_length[4]|max_length[32]');
$this->form_validation->set_rules('password_confirm', 'Password Confirm', 'required|matches[password]');


if ($this->form_validation->run() == FALSE){
$this->load->view('header_view');
$this->load->view('login_view');
$this->load->view('footer_view');
}else{

$data = array(
'name' => $this->input->post('name'),
'email' => $this->input->post('email'),
'phone' => $this->input->post('phone'),
'password' => $this->input->post('password')

);
$this->db->trans_begin();
$this->load->model('main_page');
$this->main_page->storeRegisterInfo($data);

$message['account_created'] = 'Your account has been created';
$this->load->view('admin_view', $message);
}
}

这是模型,

public function storeRegisterInfo($data){
$insert = $this->db->insert('new_users',$data);
return $insert;

}

我的数据库是这样的 enter image description here

我是 codeigniter 的新手,所以我很确定这里有很多错误,所以请帮助我,并请按步骤解释我以便更好地理解。谢谢!

这是错误 enter image description here

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com