CodeIgniter Forums
How to retieve an ID from anchor - 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: How to retieve an ID from anchor (/showthread.php?tid=12956)



How to retieve an ID from anchor - El Forum - 11-05-2008

[eluser]new developer[/eluser]
I have an anchor like the following. When i want to update, i need an id. Is there anyway i can retrieve id from this anchor. Will the id be posted? When i check $_POST array in update function $_POST array is empty. So how can i achieve the functionality i needed.Any help is appreciated.

echo anchor('user/users/update/'.$list['id'], 'Edit');


How to retieve an ID from anchor - El Forum - 11-05-2008

[eluser]zimco[/eluser]
I think if you looked at the URI Class in the users guide you might be able to find something that would help you achieve what you want to do.


How to retieve an ID from anchor - El Forum - 11-05-2008

[eluser]lmv4321[/eluser]
Code:
$idField = $this->uri->segment(x);
where x is the number of the segment. It looks like it should be 4 in your case, but it mights be 3 if you are doing some fancy routing.