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

I've a controller below. When I redirect the parameter is getting decoded and CodeIgniter can't match the URL and I get a 404. What's going on here?
My route is:
PHP Code:
$routes->get('/operations/path-item/(:segment)''Operations::path_item/$1'); 

PHP Code:
public function data()
  {
    $path $this->request->getGet('path');
    if ($path)
      return redirect()->to(base_url("/operations/path-item/' . urlencode($path")));

    $download $this->request->getGet('download');
    if ($download)
      return redirect()->to(base_url('/operations/download-item/' urlencode($download)));

    print view('header', [
      'title' => 'Data Directory',
      'meta_desc' => self::META_DESC,
    ]);

    print view('Operations/data', [
      'env' => getenv('BNCENV'),
      'today' => date('md'),
    ]);

    print view('footer');
  
Simpler is always better
Reply


Messages In This Thread
url encode - by donpwinston - 09-28-2022, 02:08 AM
RE: url encode - by kenjis - 09-28-2022, 08:39 PM
RE: url encode - by donpwinston - 09-29-2022, 05:15 PM
RE: url encode - by kenjis - 09-29-2022, 06:54 PM
RE: url encode - by donpwinston - 09-29-2022, 10:56 PM
RE: url encode - by kenjis - 09-29-2022, 11:32 PM
RE: url encode - by donpwinston - 09-30-2022, 09:24 AM
RE: url encode - by kenjis - 09-30-2022, 02:08 PM
RE: url encode - by donpwinston - 10-01-2022, 08:58 AM
RE: url encode - by heriniaina - 10-02-2022, 11:18 AM
RE: url encode - by donpwinston - 10-14-2022, 10:47 AM
RE: url encode - by donpwinston - 10-19-2022, 12:45 PM
RE: url encode - by ikesela - 10-19-2022, 05:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB