localhost send an invalid response - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: localhost send an invalid response (/showthread.php?tid=78084) Pages:
1
2
|
localhost send an invalid response - upnormal - 11-26-2020 hello there, im just learning codeigniter 4 from youtube "web programming unpas". so im followed his course to create form with post method to insert data. after insert the data succesfully, it will redirect to the index file. then, after i tried to insert data, the data its inserted successfully, but cannot redirect and showing error "localhost send an invalid response" here the code route.php Code: $routes->get('/', 'pages::index'); controller/komik.php Code: <?php any suggestion will be appreciated thanks RE: localhost send an invalid response - neoneeco - 11-27-2020 Hi where is the route /komik in your routes file ? RE: localhost send an invalid response - upnormal - 11-27-2020 (11-27-2020, 03:08 AM)neoneeco Wrote: Hiyou mean file location? in app/Controllers/komik RE: localhost send an invalid response - neoneeco - 11-27-2020 in the routes.php : PHP Code: $routes->get('/', 'pages::index'); add: $routes->get('/komik/', 'komik::index'); this is the routes /komik in your routes file, the missing route (i think) RE: localhost send an invalid response - upnormal - 11-27-2020 (11-27-2020, 01:33 PM)neoneeco Wrote: in the still not working RE: localhost send an invalid response - mylastof - 11-28-2020 Show me, the file structure to use. RE: localhost send an invalid response - InsiteFX - 11-28-2020 Take off all the beginning / slashes and it should work. PHP Code: $routes->get('/', 'pages::index'); Also your controller name should be capitalized,'Komik::index' . PHP Code: // class name must have the first letter capitalized RE: localhost send an invalid response - upnormal - 11-28-2020 (11-28-2020, 03:31 AM)InsiteFX Wrote: Take off all the beginning / slashes and it should work. still not working RE: localhost send an invalid response - neoneeco - 11-29-2020 What if : return redirect()->to(base_url()); return redirect()->to(base_url('komik/')); try and see did you try other things ? RE: localhost send an invalid response - mylastof - 11-29-2020 I want to see complete file structure, is possible? |