Welcome Guest, Not a member yet? Register   Sign In
load liblary error view
#1

[eluser]Unknown[/eluser]
Hi I have a problem on my end.
problem is the following.
loading space on the upper side is a vague theme.
What is the cause of this is just the homepage.
Please help if you let know.
English is not good

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Anasayfa extends CI_Controller {
public function index()
{
  $data['mahalle']=$this->db->get('mahalle');
  
  $this->load->library('form_validation');
  $this->form_validation->set_rules('name', 'Adınız', 'required|min_length[5]|max_length[25]|xss_clean');
  $this->form_validation->set_rules('email', 'Mail Adresiniz.', 'required|valid_email|callback_email');
  $this->form_validation->set_rules('mahalle', 'Mahalle', 'required|xss_clean|callback_mahalle');
  $this->form_validation->set_rules('sifre', 'Şifreniz', 'required|min_length[5]|max_length[25]|xss_clean');
  $this->form_validation->set_rules('sifre2', 'Şifreniz Tekrar', 'required|xss_clean|matches[sifre]');
  $this->form_validation->set_rules('onay', 'Onay', 'required');
  if ($this->form_validation->run() == FALSE)
  {
  
  $this->load->view('include/header');
  $this->load->view('page/ana',$data);
  $this->load->view('include/footer');
  
  }
  else
  {
   //form kontrol tamamdır.. Post Çekimi ve Databaseye Aktarım.
   $name=$this->input->post('name');
   $email=$this->input->post('email');
   $mahalle=$this->input->post('mahalle');
   $sifre=$this->input->post('sifre');
   $code=rand(0,7777777).rand(55,666);
   $kayit=array(
   'username'=>$name,'email'=>$email,'mahalle_id'=>$mahalle,'password'=>$sifre,'aktiv'=>0,'code'=>$code
   );
   $this->load->library('userdata');
   echo $this->userdata->aktivasyon($email,$code);
   $this->session->set_flashdata('mail', $email);
   $this->users->kayit($kayit);
  
   //header('location: '.base_url().'anasayfa/basardin');
  
  $this->load->view('include/header');
  $this->load->view('page/ana',$data);
  $this->load->view('include/footer');
  }

}
function mahalle($str){
  if ($str == 'Oturduğunuz Mahalle')
  {
   $this->form_validation->set_message('mahalle', 'Lütfen Mahalle Seçiniz!');
   return FALSE;
  }
  else
  {
   return TRUE;
  }
  }
function email($str){
  $sorgu=$this->db->query("select email from users where email='$str'");
    if ($sorgu->num_rows() > 0)
  {
   $this->form_validation->set_message('email', 'Email Adresi Mevcut!');
   return FALSE;
  }
  else
  {
   return TRUE;
  }
    }
function basardin(){
  
  $this->load->view('include/header');
  $this->load->view('page/basardin');
  $this->load->view('include/footer');
  
     }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */

my liblary class

Code:
<?php
class users {
var $yetki;
    function __construct()
    {
        $this->yetki=& get_instance();
    }
function check_login($email,$password){
  
  $row=$this->yetki->db->query("select id,email,password from users where email='$email' and password='$password'");
  if($row->num_rows() > 0){
   $this->yetki->session->set_userdata(
   array(
   'user_id'=>$row->row('id'),
   'is_login_in'=>true
   ));
   header("location: ".base_url()."profil");
   }
  else {
   $this->yetki->session->set_flashdata('error', 'Kullanıcı Adı Veya Şifre Hatalı');
   header('location: '.base_url().'user/login');
   }
  
  }
function kontrol(){
  $user=$this->yetki->session->userdata('is_login_in');
  if (!empty($user) || $user == TRUE ) {
return true;
  }
  else {
   return false;
   }
  
  }
function user_get($id){
  
  $this->yetki->db->select('*');
  $this->yetki->db->from('users');
  $this->yetki->db->join('user_data', 'user_data.user_id = users.id');
  $this->yetki->db->where('users.id', $id);
  $query = $this->yetki->db->get();
  
  return $query;
  }
  
function yetki(){
  $query = $this->yetki->db->get_where('users', array('id' => $this->yetki->session->userdata('user_id')));
  return $query->row('yetki');
  }
function kayit($data){
  $this->yetki->db->insert('users',$data);
  $son=mysql_insert_id();
  $yeni=array('user_id'=>$son);
  $this->yetki->db->insert('user_data',$yeni);
  }
function update_user($data){
  
  $this->yetki->db->where('id', $this->yetki->session->userdata('user_id'));
  $this->yetki->db->update('users', $data);
  }
function update_data($data){
  
  $this->yetki->db->where('user_id', $this->session->userdata('user_id'));
  $this->yetki->db->update('user_data', $data);
  
      }
function is_login(){
  
  $user=$this->yetki->session->userdata('is_login_in');
  if (empty($user) || $user != TRUE ) {

   $this->yetki->session->set_flashdata('message', '<div class="error_message">Lütfen Giriş yapın.</div>');

   redirect(base_url(), 'location');
  }

  } function cikis(){
  $this->yetki->session->sess_destroy();
  redirect(base_url(), 'location');
  }
} ?&gt;
#2

[eluser]mx_code_monkey[/eluser]
you wrote:
Code:
$this->load->library('userdata');
in your controller

then you library class must be titled 'Userdata'
instead you called the class 'users'. it must be capitalized, and it must match
the library call. refer to http://ellislab.com/codeigniter/user-gui...aries.html




Theme © iAndrew 2016 - Forum software by © MyBB