从查询字符串中的地址栏获取值

http://192.168.0.4/allonkid/TaskControlPanel/viewPerformance?child=80000008&datefrom=03%2F01%2F2014&dateto=04%2F30%2F2014

When this is present in address bar, then I easily get values for both :child id and date . On going to the next page using pagination, URL changes to :

http://192.168.0.4/allonkid/TaskControlPanel/viewPerformance?child=80000008&datefrom=03%2F01%2F2014&dateto=04%2F30%2F2014/2

In this case, I am not able to get the values of child id and date.

Please help me. Thanks

if you're gonna use URI routing it should be something like this:

you're URL:

http://192.168.0.4/allonkid/TaskControlPanel/viewPerformance?child=80000008&datefrom=03%2F01%2F2014&dateto=04%2F30%2F2014&page=2

Then you can put a line in your config/routes.php :

$routes['/allonkid/TaskControlPanel/viewPerformance?child=(:any)&datefrom=(:any)&dateto=(:any)/(:num)'] = '/allonkid/TaskControlPanel/viewPerformance/$1/$2/$3/$4'

where

$1 = child
$2 = datefrom
$3 = dateto
$4 = page // pagination

This can be modified depending on what you need. My tip is not to just copy and paste my answer but understand the process also make sure query string is enable in your config

Then process it by using URI segmentation