![]() |
Simple form post unwanted redirection - 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: Simple form post unwanted redirection (/showthread.php?tid=81173) |
Simple form post unwanted redirection - night_day - 01-31-2022 Hi everyone, I'm starting up with CI4 and things have been going well. I recently implemented MythAuth which has been great as well. Now I am trying to do some simple form submit, but form submits all seem to be redirecting back to another route I have. (character/1) Routes Code: $routes->match(['get', 'post'], 'admin/save', 'Admin::save'); array(0) { } The code on admin/save is simply this right now: Code: var_dump($_POST); The form is very simple too: Code: <?php echo form_open('admin/save'); ?> I am not sure if it's a mythauth thing causing the redirect, but I don't think it is since I can go to admin/save directly. Web Webdev tools up, when I hit the save button it seems to go to admin/save url but then redirects immediately, not sure why that is occuring. Any ideas? Full controller: Code: <?php RE: Simple form post unwanted redirection - kenjis - 01-31-2022 Check you routes: Code: $ php spark routes RE: Simple form post unwanted redirection - night_day - 02-01-2022 (01-31-2022, 05:24 PM)kenjis Wrote: Check you routes: Thanks for the suggestion, what am I looking for exactly? Just to verify the route is ok? Seems fine to me Code: | POST | login | \Myth\Auth\Controllers\AuthController::attemptLogin | RE: Simple form post unwanted redirection - night_day - 02-01-2022 Also of note, I look at the debugger and it seems to call the page, but get status code 303 and the response routes me back to my inital page RE: Simple form post unwanted redirection - night_day - 02-01-2022 I enabled security and forgot to include! Code: <?= csrf_field() ?> |