Hi.
I have developed a web application and in local server works perfectly, but when I upload the application to a server on the internet (godaddy) I get this errors...
When I enter the data to enter the system in fractions of a second I get these errors and the page is reloaded
and when I repeat the same operation then I get this
This is my jquery
Code:
$(document).ready(function (){
$("#frm_login").submit(function (e){
e.preventDefault();
var url = $(this).attr('action');
var method = $(this).attr('method');
var data = $(this).serialize();
$.ajax({
url:url,
type:method,
data:data
}).done(function(data){
if(data !==''){window.location.href='Welcome/index';}else{alert('EL usuario y la contrasenna no coinciden');}
});
});
});
This is my controller code (Welcome.php)
PHP Code:
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function new_user() {
$username = $this->input->post('username');
$password = sha1($this->input->post('password'));
$check_user = $this->Usuarios->login($username, $password);
if ($check_user == TRUE) {
$data = array(
'is_logued_in' => TRUE,
'id_usuario' => $check_user->id,
'perfil' => $check_user->perfil,
'username' => $check_user->user,
'password' => $check_user->pass,
'nombre' => $check_user->name
);
$this->session->set_userdata($data);
$this->index();
} else {
}
}
public function index() {
echo $this->session->userdata('perfil');
switch ($this->session->userdata('perfil')) {
case '':
$layout_data['footer'] = $this->load->view('Footer', NULL, TRUE);
$layout_data['token'] = $this->token();
$this->load->view('Welcome_message', $layout_data);
break;
case 'Administrator':
redirect(base_url() . 'Admin');
break;
case 'Operator':
redirect(base_url() . 'Suscriptor');
break;
default:
$layout_data['footer'] = $this->load->view('Footer', NULL, TRUE);
$this->load->view('Welcome_message', $layout_data);
break;
}
}
}
I hope somebody can help me.
THX!!!!