Passing id variable from an anchor codeigniter -


so guys know , doing wrong here, trying pass id of username anchor tag this

$value = '12';  echo anchor('mycontroller/'.$value.'', 'click here'); 

the url displays: //myroot/mycontroller/12

the page supposed load not loading not found because value 12 recognized function expect 12 load. controller loading fine without /12 value.

i have used url segments no results. know pretty easy have 2 hours struggle now.

thank in advance.

the problem think

you have index() function in controller.

when url

//myroot/mycontroller 

it loads

//myroot/mycontroller/index 

by default,

but when url //myroot/mycontroller/12

it should give error , because no function defined

try change url to

//myroot/mycontroller/index/12 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -