Welcome Guest, Not a member yet? Register   Sign In
Input Error in Linux : Undefined property: Welcome::$input
#1

(This post was last modified: 04-30-2020, 03:12 PM by jreklund.)

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]
Reply
#2

(This post was last modified: 04-30-2020, 03:15 PM by jreklund.)

Try welcome/save, not Welcome/save.
Reply
#3

(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
Reply
#4

@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?
Reply
#5

(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.
Reply
#6

@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/tutor...ate-a-form .
Reply
#7

(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/tutor...ate-a-form olarak kullanın.

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

@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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB