[eluser]MMCCQQ[/eluser]
hI!
i started a new project. I need tips to make better Web App about structure.
i made this
SignUp - Controller
Code:
function Signup()
{
if ($_POST['password'])
{
if(!$_POST['password'] == $_POST['password2']){
$info['msg'] = 'Please enter the same password twice';
$contents['main'] = $this->load->view('index/signup_page',$info);
}else{
$this->db->where('email', $_POST['email']);
$query = $this->db->get('members');
if ($query->num_rows() > 0)
{
$info['msg'] = $_POST['email'].'is registered in our database.';
$contents['main'] = $this->load->view('index/signup_page',$info);
}
else
{
if ($this->db->insert('members', $_POST))
{
redirect('/'.$_POST['username']);
}
else
{
$info['msg'] = 'An error occurred, Try Again.';
$contents['main'] = $this->load->view('white_page', $info);
}
}
}
}
else
{
$info['msg'] = false;
$contents['main'] = $this->load->view('index/signup_page', $info);
}
}