CodeIgniter Forums
uri segments question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: uri segments question (/showthread.php?tid=47062)



uri segments question - El Forum - 11-24-2011

[eluser]Unknown[/eluser]
I have a link on my homepage which points to another controller:

Code:
<p><a href="&lt;?php echo base_url() . 'index.php/user/' . $user-&gt;id; ?&gt;">contact</a></p>

In my user controller I have the following code (for debugging purposes):

Code:
class User extends CI_Controller {


function index($user_id=0) {
  echo $user_id;
}

}

It's giving me a 404 error when I click the link on my homepage. Can someone please tell me why?

Thank you.