CodeIgniter Forums
Input Error in Linux : Undefined property: Welcome::$input - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Input Error in Linux : Undefined property: Welcome::$input (/showthread.php?tid=76293)



Input Error in Linux : Undefined property: Welcome::$input - musti7084 - 04-30-2020

I am learning codeigniter. I am watching a course videos in udemy. I wrote the codes in the video. CODES ARE WORKING ON WINDOWS BUT NOT WORKING IN LINUX Smile  Please help me.


Controller :

Code:
class Welcome extends CI_Controller {

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

    }

    public function index()
    {

        $this->load->view('form');

    }

    public function save(){
        
        echo $this->input->post("name");
    }
    
}


View :


Code:
<form action="<?=base_url("Welcome/save")?>" method="post">

    <input type="text" id="fname" name="name"><br>
    <button type="submit">Gönder</button>
</form>


[Image: Ap6l0E.png]


RE: Input Error in Linux : Undefined property: Welcome::$input - jreklund - 04-30-2020

Try welcome/save, not Welcome/save.


RE: Input Error in Linux : Undefined property: Welcome::$input - musti7084 - 04-30-2020

(04-30-2020, 03:15 PM)jreklund Wrote: Try welcome/save, not Welcome/save.

No, error continues. Codeigniter folder permissions are 755. These codes work on windows.Very interesting Sad


RE: Input Error in Linux : Undefined property: Welcome::$input - php_rocs - 04-30-2020

@musti7084,

Have you tried echoing out any value (instead of just the input value) just to see if you are able to get to the welcome/save location? have you tried typing in the location the form is trying to push the results to? Does the Welcome page work without any errors? What is the permission of the Welcome.php file?


RE: Input Error in Linux : Undefined property: Welcome::$input - musti7084 - 04-30-2020

(04-30-2020, 04:57 PM)php_rocs Wrote: @musti7084,

Have you tried echoing out any value (instead of just the input value) just to see if you are able to get to the welcome/save location?  have you tried typing in the location the form is trying to push the results to?  Does the Welcome page work without any errors?  What is the permission of the Welcome.php file?

Welcome page is working and its permission is 755. I copied codeigniter folder and pasted htdocs on linux. No change.


RE: Input Error in Linux : Undefined property: Welcome::$input - php_rocs - 05-01-2020

@musti7084,

Assuming that you are using CI3 you forgot to load the necessary helpers/libraries
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');

Use this as an example https://codeigniter.com/userguide3/tutorial/create_news_items.html#create-a-form .


RE: Input Error in Linux : Undefined property: Welcome::$input - musti7084 - 05-01-2020

(05-01-2020, 11:49 AM)php_rocs Wrote: @ musti7084,

CI3 kullandığınızı varsayarak, gerekli yardımcıları / kütüphaneleri yüklemeyi unuttunuz
$ this-> load-> helper (dizi ('form', 'url'));
$ this-> load-> kitaplığı ( 'form_validation'); 

Bunu örnek olarak https://codeigniter.com/userguide3/tutorial/create_news_items.html#create-a-form olarak kullanın.

But these codes are working on windows. Why doesn't work on linux ?


RE: Input Error in Linux : Undefined property: Welcome::$input - php_rocs - 05-02-2020

@musti7084,

Another thing to look for is CaSe sensitivity. Windows is loose where linux is exact when it comes to case sensitivity. For example welcome.php and Welcome.php is the same in Windows but different in Linux. Check to make sure your code (Controllers, Models and Views are using the exact names.