Sending variables |
[eluser]szulcseban[/eluser]
I want to send a variable $id in that way: <a href="<?php echo site_url('admin/edit/$id');?>">Edytuj...</a>. How can I get this variable from 'edit' controller?
[eluser]reset[/eluser]
Hello, You can do that with the URI library. There's a function ($this->uri->segment(n)), you can do for this url http://localhost/codeigniter/edit/$id n = 1 $this->uri->segment(1) --> for controller n = 2 $this->uri->segment(2)--> for $id ...
[eluser]jcopling[/eluser]
If you have a controller called edit that looks like this: Code: class Edit extends Controller{ Code: class Edit extends Controller{ |
Welcome Guest, Not a member yet? Register Sign In |