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

(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
Reply
#12

/ 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
Reply
#13

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

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

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

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

- in app-
route_to('my-route',$path);
Reply




Theme © iAndrew 2016 - Forum software by © MyBB