Welcome Guest, Not a member yet? Register   Sign In
Internal server error when calling AJAX
#1

[eluser]dauber[/eluser]
So I'm trying to call my "login" method from my "Login" controller via AJAX, with jQuery. But I keep getting an internal server error, saying "The action you have requested is not allowed." I pretty much copied and pasted this from another site I'm working on...

Here's my controller:

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

class Login extends CI_Controller {
    
        public function construct() {
            parent::__construct();
            $this->load->helper('form');
        }

public function index() {
}
        
        public function login() {
            $email = $this->input->post('email',TRUE);
            $password = $this->input->post('password',TRUE);
        }
}

Here's the AJAX call:

Code:
var email = $('#ltd_email').val();
            var password = $('#ltd_password').val();
            var login_post_data = {
                'email': email,
                'password': password
            };
            $.post('/index.php/login/login',login_post_data,function(result) {
                console.log("RESULT:");
                console.log(result);
            });


Messages In This Thread
Internal server error when calling AJAX - by El Forum - 10-19-2014, 08:04 PM
Internal server error when calling AJAX - by El Forum - 10-19-2014, 08:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB