how can I do to hide Id from URL?
- Single Page
Posted 28 February 2012 - 17:12 PM
how can I do to hide Id From URL?
I need to create a form where each user can modify our data but can not see the ID parameter in the url
sorry for my english!
[color=#282828][font=helvetica, arial, sans-serif]Best Regards[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]Ale[/font][/color]
Posted 28 February 2012 - 22:14 PM
The only simple way to not have the id in URL is to have your form in an iframe. I know that you are looking at something else more secure but there is the only solution I can think for now.
Posted 05 July 2012 - 12:21 PM
Posted 19 February 2013 - 18:27 PM
<?php class MY_URI extends CI_URI { function __construct() { parent::__construct(); } function set_segment($n,$value) { $this->segments[$n] = $value; return $this; } }
public function profile() { $user_id = $this->session->userdata('user_id'); if($this->uri->segment(4) == 'edit'){ $this->uri->set_segment(5,$user_id); } $crud = new grocery_CRUD(); $crud->set_table('users'); $crud->edit_fields('email','lastname'); $crud->unset_add(); $crud->unset_back_to_list(); $crud->unset_list(); try{ $output = $crud->render(); $this->_example_output($output); } catch(Exception $e) { if($e->getCode() == 14){ redirect('admin/users/profile/edit'); }else { show_error($e->getMessage()); } } }
Posted 20 February 2013 - 23:00 PM
Where do you initialize your uri class object?
Posted 21 February 2013 - 13:23 PM
Hi Davidoster!
The class is instantiated by calling the controller automatically.
Look this link: http://ellislab.com/codeigniter/user-guide/general/core_classes.html