You've already forked codeigniter_test2
first commit
This commit is contained in:
24
application/models/user_model.php
Normal file
24
application/models/user_model.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
class User_model extends CI_Model{
|
||||
|
||||
function simpan_user()
|
||||
{
|
||||
$simpan_data=array(
|
||||
'nama_lengkap' => $this->input->post('nama_lengkap'),
|
||||
'username' => $this->input->post('username'),
|
||||
'password' => md5($this->input->post('password')),
|
||||
'email' => $this->input->post('email'),
|
||||
'alamat' => $this->input->post('alamat')
|
||||
);
|
||||
$simpan = $this->db->insert('user', $simpan_data);
|
||||
return $simpan;
|
||||
}
|
||||
function login($user,$pass)
|
||||
{
|
||||
$pass = md5($pass);
|
||||
$sql1 = "SELECT * FROM USER WHERE username = '$user' AND password = '$pass'";
|
||||
$rs = mysql_query($sql1);
|
||||
$r = mysql_num_rows($rs);
|
||||
if ($r=='1'){return true;}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user