Welcome Guest, Not a member yet? Register   Sign In
Random Access Denied
#1

Hello, I looked a little bit the forum. I'm new here, so please excuse me if I'm doing something wrong.

I hava a CI application that has a dashboard to manage the pages. Sometimes I get an error 403 and an error 500 in somepages, but refreshing or accessing again this page, the page works correctly. Apparently this occur just in the pages of the dashboard.

Thank you.
Reply
#2

You need to explain what your problem is an any errors that you are getting.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

I'm using google chrome (Version 56.0.2924.87 64-bit), and I go to my application, but sometimes, I can't tell when or which page, gives me an access denied error, and sometimes it works perfectly. If I get an error and then refresh the same page, this page works perfectly.

The imagem (       ) show the error I get just right now.

The imagem (       ) show same page that gives me the error before, just refreshed and working.
Reply
#4

I am also running Chrome x64 and do not have this problem, can you use the advanced forum editor and show the code for your form?

I am running Windows 10 Pro x64
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

It's possible something on the server is offline and after my request it's initialized and become online, like a service? Because after the first error on the page, the error takes some hours to occur again. I'm using a free hosting service.

Later I will show the code. I'm at work right now, and the code is in my personal notebook.

Thank you.
Reply
#6

Check you php log and see what the 500 error is.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#7

How can I check this PHP log, please?
Reply
#8

What environment are running in? Xampp, linux?
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#9

I think it's running in a linux instance. Apache version 2.4 and PHP version 5.5.

This is the controller PainelDeControle.php:

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

class PainelDeControle extends CI_Controller {

 public function index()
    {
   $this->load->helper('myhelperacesso');
   if (usuarioLogado()) {
     $this->load->view('templates/header.php');
     $this->load->view('templates/headerPainelDeControle.php');
     $this->load->view('templates/menuHeaderPainelDeControle.php');
     $this->load->view('painelDeControle/index.php');
     $this->load->view('templates/menuFooterPainelDeControle.php');
     $this->load->view('templates/footerPainelDeControle.php');
     $this->load->view('templates/footer.php');
   } else {
     $this->session->set_flashdata("mensagem-fracasso", "Acesso negado. Nenhum usuário logado.");
   
     $this->load->helper("url");
     redirect(base_url("index.php/usuario/entrar"));
   }
    }
}

?>

In the index() function the else statement is executed, because there's no user yet defined.
Reply
#10

According to the documentation I think you need to upgrade your PHP version.

PHP version 5.6 or newer is recommended.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB