CodeIgniter Forums
CI3 form validation error on 1and1 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: CI3 form validation error on 1and1 (/thread-63438.html)



CI3 form validation error on 1and1 - patguitar - 10-30-2015

Hello,

I use CI3 with HMVC module from https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc

All things works fine on localhost with Wamp 2.5 and php5.5

But this morning, I transfer my website on shared hosting on 1and1, and I have this message when I want use Controler in a module who use form_validation


Code:
A PHP Error was encountered

Severity: Error
Message: Cannot access protected property CI_Form_validation::$CI
Filename: controllers/Prospects.php
Line Number: 11
Backtrace:

I made all modifications, add library : My_Form_validation.php


Code:
class MY_Form_validation extends CI_Form_validation

{
    public $CI;
}

And add in the module controler :


Code:
class Myclass extends MX_Controller {

    
     function __construct()
    {
        parent::__construct();

        $this->load->library('form_validation'); // THIS IS THE LINE 11
        $this->form_validation->CI =& $this;
    }

It does't work on 1and1.

I don't understand why, could you help me?

Thank's

Patrice


RE: CI3 form validation error on 1and1 - Narf - 10-30-2015

It's not that it doesn't work on 1and1. It only works on Windows and some OSX configurations, because that's when you have case-insensitive filenames.

The file must be named 'MY_Form_validation.php', not 'My_Form_validation.php'.


RE: CI3 form validation error on 1and1 - patguitar - 10-30-2015

Ok, thank's for the answer, you are right, for the case, I made mistake !

But I renamed the file as 'MY_Form_validation.php'.

I verified all the case, but I get the same error.

Code:
A PHP Error was encountered

Severity: Error

Message: Cannot access protected property MY_Form_validation::$CI

Filename: controllers/Prospects.php

Line Number: 11

Backtrace:



RE: CI3 form validation error on 1and1 - patguitar - 11-03-2015

Hello,

After further testing, I realized that it was the file that was corrupted MY_Form_validation although readable.

After I recreated another file with the same code (first post), no problem!

Thanks for your help