Hello,
Fatal error: Cannot redeclare Mpages::call_gallery() in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\models\Mpages.php on line 152
A PHP Error was encountered
Severity: Compile Error
Message: Cannot redeclare Mpages::call_gallery()
Filename: models/Mpages.php
Line Number: 152
Backtrace:
I am facing this strange error message from my CI program. Maybe someone can help me out!
I type this:
http://127.0.0.1/CompanyGiondaCI/
I expect my login page would comes out. It seems there is a missing link between the url I type and the program that I appears.
config/routes.php
views/login.php
Controllers/Cpages.php
Fatal error: Cannot redeclare Mpages::call_gallery() in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\models\Mpages.php on line 152
A PHP Error was encountered
Severity: Compile Error
Message: Cannot redeclare Mpages::call_gallery()
Filename: models/Mpages.php
Line Number: 152
Backtrace:
I am facing this strange error message from my CI program. Maybe someone can help me out!
I type this:
http://127.0.0.1/CompanyGiondaCI/
I expect my login page would comes out. It seems there is a missing link between the url I type and the program that I appears.
config/routes.php
PHP Code:
$route['default_controller'] = 'cpages/login';
views/login.php
PHP Code:
<?php $this->load->library('form_validation'); ?>
<?php echo validation_errors(); ?>
<?php echo form_open('cpages/ceklogin'); ?>
<div class="login-card">
<h2>Gionda CMS Login</h2><br>
<form>
<div class="login"><input type="text" name="username" placeholder="Username"></div>
<div class="login"><input type="password" name="password" placeholder="Password"></div>
<br>
<input type="submit" name="login" class="login login-submit" value="login">
</form>
<div class="login-help">
<a href="#">Register</a> • <a href="#">Forgot Password</a>
</div>
</div>
Controllers/Cpages.php
PHP Code:
public function ceklogin() {
$username = $this->input->post('username', TRUE);
$password = $this->input->post('password', TRUE);
$this->db->where('username', $username);
$this->db->where('password', $password);
$query=$this->db->get('login');
if ($query->num_rows() == 1)
{
// echo 'LOGIN BERHASIL !';
$this->load->model('Mpages');
$data['login']=$this->db->get('login');
$data['login'] = $this->Mpages->login();
$this->load->view('index', $data);
}
else
{
// echo 'LOGIN GAGAL !';
$data['warning']='Your username and password are wrong !';
$this->load->view('login', $data);
}
}