Welcome Guest, Not a member yet? Register   Sign In
error in my login script
#1

[eluser]Nathan Payne[/eluser]
Hi,

I am new to this so please point out my obvious mistakes and tell me. Anyway, I am in the process of creating my first CI website and I have run into a problem creating my simple login script.

Code is below.

Controller:
Code:
<?php
    
    class Admin extends Controller{
        
    function Admin()
    {
        parent::Controller();
    }
    
    function index()
    {
        $this->load->model('admin_model', '', TRUE);
    }
    
    function verify()
    {
        if ($this->input->post('username')){
            $username = $this->input->post('username');
            $password = $this->imput->post('password');
            
            $this->admin_model->authorize($username, $password);
            if ($_SESSION['userid'] > 0){
                redirect('admin/dashboard','refresh');
            }
        }else
        {
            $this->layout->view('login');
        }
    }
    ?>

I get the following error: Parse error: syntax error, unexpected ';', expecting T_FUNCTION in \system\application\controllers\admin.php on line 30
#2

[eluser]Nathan Payne[/eluser]
I need the solution fast, does anyone know?
#3

[eluser]chriskelley[/eluser]
Looks like you're missing the closing brace for your class.

hth
c
#4

[eluser]Nathan Payne[/eluser]
even when I put the } it still dosn't work it now tells me...

Parse error: syntax error, unexpected '{', expecting '(' in system\application\models\admin_model.php on line 5
#5

[eluser]chriskelley[/eluser]
Now you've got a syntax error in your model. It's telling you right there in the output what the problem is - dig into your models/admin_model.php file and follow the error.

good luck
c




Theme © iAndrew 2016 - Forum software by © MyBB