passing url variable |
[eluser]jmcc1982[/eluser]
Hi I would like to pass a variable from my index page to my form page in the url. I have always used page.php?id=1 but now with CI when I try to pass the variable that way I get this error: 404 Page Not Found The page you requested was not found. I appreciate any help. Jay
[eluser]lenwood[/eluser]
Take a look at the use of segment in the uri class user guide. Code: $this->uri->segment(n)
[eluser]jmcc1982[/eluser]
This is how I reference the link: <a href="<?php site_url('special_deals/form');?>?d=1" class="roll"> This is my Controller: <?php class Special_deals extends Controller { var $data = array(); function Special_deals() { parent::Controller(); $this->data['current_menu_tab'] = "special_deals"; $this->data['message'] = ''; } function index() { } function page($page) { $this->load->view('special_deals/'.$page); } function form() { $this->load->view('special_deals/form'); } } /* End of file welcome.php */ /* Location: ./system/application/controllers/welcome.php */
[eluser]jmcc1982[/eluser]
hi Thanks so do I just add a var to the beginning $var = $this->uri->segment(n) do I need to call anything in my constructor
|
Welcome Guest, Not a member yet? Register Sign In |