EllisLab text mark
Advanced Search
     
Fatal error: Call to undefined method CI_Loader::post() Help me please..!!
Posted: 19 October 2012 09:33 AM   [ Ignore ]
Joined: 2012-10-19
2 posts

Help Me please it’s display this error after click on submit
Fatal error: Call to undefined method CI_Loader::post() in C:\AppServ\www\codeIgniter\application\controllers\welcome1b.php on line 42” and i don’t know how to fix it. Thanks You

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
welcome1b extends CI_Controller {
 
function __construct()
 
{
  parent
::__construct();
  
$this->load->helper(array('url','captcha','form','html'));
  
$this->load->library('session');
  
$this->load->model('Captcha_model','Captcha');
 
}
 
function login()
 
{
  $attr 
= array(
      
'img_path'   => './captcha/',
      
'img_url'   => base_url().'captcha/',
      
'img_width'  => 150,
      
'img_height' => 30
     
);
  
$captcha create_captcha($attr);
  
$time  $captcha['time'];
  
$ip   $this->input->ip_address();
  
$word  $captcha['word'];
  
#insert
  
$this->Captcha->_insert($time,$ip,$word);
  
#create form
  
echo $captcha['image'];
  echo 
"<br><br>";
  echo 
form_open('welcome1b/dologin');
  echo 
form_input('word');
  echo 
form_submit('act','Check');
  echo 
form_close();
  
 
}
 
function dologin()
 
{
   $act 
$this->input->post('act');
   if(empty(
$act))
   
{
    redirect
('welcome1b/login');
   
}else{
    $word 
$this->load->post('word');
    
$exp time() - 7200;
    
$ip $this->input->ip_address();
    
#check captcha word
    
$result $this->Captcha->_check($ip,$word,$exp);
    if(
$result)
    
{
     
echo "Data Correct";
    
}
    
else {
     {
      
echo "Data incorrect";
     
}
    }
   }
 }
 
Posted: 19 October 2012 09:55 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2011-02-09
38 posts

should
$word = $this->load->post(‘word’);

be
$word = $this->input->post(‘word’);?

 
Posted: 20 October 2012 04:05 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2012-10-19
2 posts
Ed Robindon - 19 October 2012 09:55 PM

should
$word = $this->load->post(‘word’);

be
$word = $this->input->post(‘word’);?

oh haha Thank you Very much these code make me confuse haha Thanks so much sir