0
I took an internal system of the company to give maintenance and I do not have much knowledge in PHP
. When I log on to the application from the company server I can access it normally. I went up the application in a hosting, however, when trying to log in by entering email and password, what appears is a blank screen, and I can’t log in.
Follow the code for analysis:
View 'login/login':
<form class="form-horizontal" method="POST" action="<?= site_url ("Login/entrar") ?>">
<input type="hidden" name="_token" value="GFSc0XajfwJeVrp2CzYdftCoZ8tslaOkBfIIbLdc">
<div class="form-group">
<label for="login" class="col-md-4 control-label">E-Mail</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="login" value="" required autofocus>
</div>
</div>
<div class="form-group">
<label for="senha" class="col-md-4 control-label">Senha</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="senha" required>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
</div>
</div>
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Entrar
</button>
<!--a class="btn btn-link" href="http://192.168.31.8/vistarraf/password/reset" disabled=disabled>
Esqueceu sua senha?
</a -->
</div>
</div>
</form>
Controller 'login':
class Login extends CI_Controller{
public function index(){}
public function entrar (){
$login = $this->input->post("login");
$senha = md5($this->input->post("senha"));
$this->db->where("email", $login);
$this->db->where("password", $senha);
$query = $this->db->get("users");
if ($query->num_rows() == 1){
$this->load->helper('weather_helper');
$previsao = MostraPrevisao(4956);
$dados = array(
'titulo' => 'Intranet',
'tela' => 'inicio',
'previsao' => $previsao
);
$this->load->view('home_view', $dados);
}
else {
$mensagem = "Email e Senha não encontrados";
$dados = array(
'msg' => $mensagem,
'tela' => 'welcome_message_error'
);
$this->load->view('login_view', $dados);
}
}
}
Need to check the type of error being returned.
– MagicHat
Matheus, hello! Take a look at whether the base URL is correctly configured in the /Applications/config/config.php file.
– Cesar Augusto
how can I check the type of error that is returning?
– Matheus Masuda
@Cesaraugusto, the base URL is configured.
– Matheus Masuda
Anyway it was the method to call
$this->load->view('login_view', $dados);
, after all, anything other than$query->num_rows() == 1
was supposed to fall into the exception, but for some reason he’s not calling the exception, which makes me think it’s something in the server configuration or someview
missing, or something like that.– ShutUpMagda