Welcome Guest, Not a member yet? Register   Sign In
302 moved temporarily
#1

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

[Image: error1.jpg]

and when I repeat the same operation then I get this

[Image: error2.jpg]

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'NULLTRUE);
 
               $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'NULLTRUE);
 
               $this->load->view('Welcome_message'$layout_data);
 
               break;
 
       }
 
   }



I hope somebody can help me.
THX!!!!
Reply


Messages In This Thread
302 moved temporarily - by gattsu - 11-28-2018, 02:32 PM
RE: 302 moved temporarily - by ciadmin - 11-28-2018, 02:48 PM
RE: 302 moved temporarily - by gattsu - 11-29-2018, 11:47 AM
RE: 302 moved temporarily - by dave friend - 11-29-2018, 02:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB