Welcome Guest, Not a member yet? Register   Sign In
404 when accessing a function in a controller
#5

In View/signup.php
PHP Code:
<form action="<?php echo base_url(); ?>/SignupController/store" method="post"

In app/Config/Routes.php:
PHP Code:
$routes->post('/SigupController/(:any)''SignupController::$1'); 

Result (called using form->Submit): 404, File not found.
Result (using https://example.com/SignupController/store in Browser): 404, File not found.


In View/signup.php
PHP Code:
<form action="<?php echo base_url(); ?>store" method="post"


In app/Config/Routes.php:
PHP Code:
$routes->get('/store''SignupController::store'); 

Result (called using form->Submit): 404, File not found.
Result (using https://example.com/store in Browser): Function called correctly, page displayed.

In View/signup.php
PHP Code:
<form action="<?php echo base_url(); ?>/store" method="post"


In app/Config/Routes.php:
PHP Code:
$routes->post('/store''SignupController::store'); 

Result (called using form->Submit): 404, File not found.
Result (using https://example.com/store in Browser): Function called correctly, page displayed.

~Dave
Reply


Messages In This Thread
RE: 404 when accessing a function in a controller - by davecoventry - 09-11-2022, 12:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB