CodeIgniter Forums
url encode - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Support (
+--- Thread: url encode (/showthread.php?tid=83465)

Pages: 1 2

RE: url encode - donpwinston - 10-14-2022

(10-02-2022, 11:18 AM)heriniaina Wrote: Just try
PHP Code:
redirect()->to("/operations/path-item/' . $path); 

$path needs to be url encoded or it won't work. But now I think using the '%' as part of the url is not valid. You get a bad request error (400 status code). is invalid!

Need to use or better yet

RE: url encode - donpwinston - 10-19-2022

/ chars in $path will screw it up. They need to be url encoded. But this apparently causes a bad url request. Need to use ?path=xxxxxx.

RE: url encode - ikesela - 10-19-2022

suggestion (using named route):
$routes->get('/operations/path-item/(:segment)', 'Operations::path_item/$1');

$routes->get('/operations/path-item/(:segment)', 'Operations::path_item/$1', ['as' => 'my-route');

-how to use-
return redirect()->route('my-route',[$path]);

- in app-