Welcome Guest, Not a member yet? Register   Sign In
url encode

(This post was last modified: 10-14-2022, 10:52 AM by donpwinston.)

(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).

https://acme.com/%2Fabc%2F/xyz. is invalid!

Need to use https://acme.com?x=/abc/xyz or better yet https://acme.com?x=%2Fabc%2Fxyz
Simpler is always better

/ 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.
Simpler is always better

(This post was last modified: 10-19-2022, 05:08 PM by ikesela.)

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-

Theme © iAndrew 2016 - Forum software by © MyBB